- 博客(615)
- 资源 (50)
- 收藏
- 关注
原创 bash源代码分析----rl_redisplay函数分析
(gdb) p rl_display_prompt$36 = 0x726c88 "[root@localhost bash-4.2.53]# "此函数比较大,慢慢分析。rl_display_prompt确实是指向了提示字符串。现在的任务还是,什么时候,哪个函数里面具体打印出提示字符串的?/* Basic redisplay algorithm. */voidrl_redisplay (){ register int in, out, c, linenum, cursor_line.
2021-03-11 11:24:12 582
原创 bash源代码分析----readline_internal_setup函数会打印出提示字符串
(gdb) n394 (*rl_redisplay_function) ();(gdb) n[root@localhost bash-4.2.53]# 398 if (rl_editing_mode == vi_mode)(gdb)STATIC_CALLBACK voidreadline_internal_setup (){ char *nprompt; _rl_in_stream = rl_instream; _rl_out_strea...
2021-03-11 11:12:45 185
原创 bash源代码分析----readline_internal_setup函数分析
readline_internal_setup函数里面打印出提示字符串,离目标又近了一步。/* Read a line of input from the global rl_instream, doing output on the global rl_outstream. If rl_prompt is non-null, then that is our prompt. */static char *readline_internal (){ int eof;...
2021-03-11 10:59:51 227
原创 bash源代码分析----yy_readline_get函数主要是调用了readline函数
/* **************************************************************** *//* *//* Let input be read from readline (). *//* *//* **************************************...
2021-03-11 10:15:45 149
原创 bash源代码分析----yy_getc函数分析
(gdb) syy_readline_get () at ./parse.y:14271427 {(gdb) p *(bash_input.getter)$29 = {int (void)} 0x41e830 <yy_readline_get>(gdb)shell_getc函数会调用yy_getc函数yy_getc函数就是一个指针引用/* Call this to get the next character of input. */static intyy_ge...
2021-03-11 10:11:11 409
原创 bash源代码分析----read_token函数调用shell_getc函数返回10也就是回车符
/* Function for yyparse to call. yylex keeps track of the last two tokens read, and calls read_token. */static intyylex (){ if (interactive && (current_token == 0 || current_token == '\n')) { /* Before we print a prompt, we might...
2021-03-11 09:35:59 268
原创 bash源代码分析----read_token函数调用了shell_getc函数
/* Read the next token. Command can be READ (normal operation) or RESET (to normalize state). */static intread_token (command) int command;{ int character; /* Current character. */ int peek_char; /* Temporary look-ahead charact...
2021-03-10 17:16:50 259
原创 bash源代码分析----yylex函数分析和decode_prompt_string函数负责分析并返回提示字符串
yylex函数调用位置:y.tab.c中if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; }/* Function for yyparse to call. yylex keeps track of the last two tokens read, and calls read_token. */static intyylex (...
2021-03-10 16:55:58 694
原创 bash源代码分析----bison--debug或-t选项的作用
bison--debug或-t选项的作用bison -y parse.y/* Debug traces. */#ifndef YYDEBUG# define YYDEBUG 0#endif#if YYDEBUGextern int yydebug;#endifbison -y --debug parse.y/* Debug traces. */#ifndef YYDEBUG# define YYDEBUG 1#endif#if YYDEBUGextern int yydeb..
2021-03-10 11:03:43 501
原创 bash源代码分析----打印提示符是如何实现的和get_string_value函数获取环境变量的值
/* Return the string value of a variable. Return NULL if the variable doesn't exist, or only has a function as a value. Don't cons a new string. */char *get_string_value (var_name) char *var_name;{ SHELL_VAR *var = find_variable (var_name...
2021-03-09 16:25:28 184
原创 bash源代码分析----bash --login的作用和--noprofile的作用
[root@localhost ~]# cat ~/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHlshell="login shell will see this ...
2021-03-09 15:22:51 1884
原创 bash源代码分析----maybe_execute_file函数分析
执行哪些启动脚本? if (act_like_sh) maybe_execute_file ("~/.profile"); else { if (maybe_execute_file ("~/.bash_profile") == 0) if (maybe_execute_file ("~/.bash_login") == 0) maybe_execute_file ("~/.profile");...
2021-03-09 15:08:10 174
原创 bash源代码分析之shell.c中mail函数对HISTFILE的处理
/* Initialize the interactive history stuff. */ if (!shell_initialized) { char *hf = get_string_value ("HISTFILE"); if (hf) read_history (hf); } } /* Save the history of executed commands. */ if (inter...
2021-03-09 11:50:14 192
原创 bash源代码分析----shell_initialize函数和variables.c的关系
/* Do whatever is necessary to initialize the shell. Put new initializations in here. */shell_initialize (){ /* Line buffer output for stderr. If your machine doesn't have either of setlinebuf or setvbuf, you can just comment out the buffer...
2021-03-09 11:43:14 347 1
原创 bash源代码分析----after_flags之前处理flags和after_flags之后初始化shell_initialize函数和read_and_execute部分
第一部分:after_flags之前处理flags第二部分:after_flags之后初始化shell_initialize函数第三部分:read_and_execute部分main (argc, argv, env) int argc; char **argv, **env;{ int i, arg_index = 1; extern int yydebug; FILE *default_input = stdin; char *local_pend...
2021-03-09 11:36:36 215
原创 bash源代码分析----reader_loop函数分析和read_but_dont_execute的作用和just_one_command的作用
reader_loop (){ extern int indirection_level; int our_indirection_level; COMMAND *current_command = (COMMAND *)NULL; our_indirection_level = ++indirection_level; while (!EOF_Reached) { sighandler sigint_sighandler (); int code =...
2021-03-09 11:18:05 359
原创 bash源代码分析----login shell登录shell和interactive交互式shell的关系以及main函数中的change_flag_char函数
/* Non-zero means that this shell is a login shell. Specifically: 0 = not login shell. 1 = login shell from getty (or equivalent fake out) -1 = login shell from "-login" flag. -2 = both from getty, and from flag.*/int login_shell = -2;/* ...
2021-03-09 11:06:25 233
原创 bash源代码分析----shell_builtins[]数组和shell_flags[]数组的一一对应关系
builtins.c文件中的 shell_builtins[]数组和struct builtin shell_builtins[] = { { "set", set_builtin, 1, "set [-aefhkntuvx] [arg ...]]", " -a Mark variables which are modified or created for export\n\ -e Exit immediately if a command exits wit...
2021-03-09 10:36:29 287
原创 bash源代码分析----set_builtin函数和change_flag函数的关系
下面的文件的来源:http://www.oldlinux.org/Linux.old/gnu/bash/bash-1.05-linux.tar.gzset命令和flags.c文件密切相关。/* builtins.h -- a list of all commands that are shell builtins. See builtins.c to see where to add more builtins. */#include "config.h"int colon...
2021-03-09 10:24:14 386
原创 bash源代码分析之重定向----do_redirection_internal()函数
/* Do the specific redirection requested. Returns errno in case of error. If FOR_REAL is zero, then just do whatever is neccessary to produce the appropriate side effects. REMEMBERING, if non-zero, says to remember how to undo each redirection....
2021-03-03 15:35:13 147 1
原创 centos----bash中的重定向M>&N中的&引用符号的作用
gcc -c -g program.c >& compiler.txt我知道&> filename会将stdout和stderr重定向到文件filename。但在这种情况下,&符号是在大于号后。它看起来像其形式M>& N,其中M和N是文件描述符。在上面的代码段中,M = 1和N =’compiler.txt’[root@centos ~]# ls >&-bash: syntax error near unexpected ..
2021-03-03 14:39:23 519 1
原创 centos----utmpdump源代码分析一
/** utmpdump** Simple program to dump UTMP and WTMP files in raw format, so they can be* examined.** Based on utmpdump dump from sysvinit suite.** Copyright (C) 1991-2000 Miquel van Smoorenburg <miquels@cistron.nl>** Copyright (C)...
2021-02-27 10:48:56 529
原创 centos----util-linux软件包文件列表
[root@VM-0-12-centos xxxxxxxx]# rpm -qf /bin/utmpdumputil-linux-2.32.1-22.el8.x86_64[root@VM-0-12-centos xxxxxxxx]# rpm -ql util-linux|grep "bin"/usr/bin/cal/usr/bin/chmem/usr/bin/chrt/usr/bin/col/usr/bin/colcrt/usr/bin/colrm/usr/bin/column/usr/b
2021-02-27 10:33:27 860
原创 dropbear源代码分析之二----openwrt的登录到root用户公钥为什么保存在/etc/dropbear/authorized_keys
openwrt的登录到root用户公钥为什么保存在/etc/dropbear/authorized_keys?原因是openwrt对dropbear做了一点点的更改!!!打了一个patch下面是一个openwrt的源代码https://pan.baidu.com/share/link?shareid=3399010809&uk=939937960...
2021-01-21 19:00:34 895
原创 【全网首发】dropbear源代码分析之一::checkfileperm函数---dropbear免密登录的三个条件
dropbear[28567]: /root must be owned by user or root, and not writable by others# chmod 700 root# chown root:root /root
2021-01-20 17:31:39 1605
原创 centos----coreutils套件也包括chroot工具啊
[root@VM-0-12-centos log]# rpm -ql coreutils/usr/bin/[/usr/bin/arch/usr/bin/b2sum/usr/bin/base32/usr/bin/base64/usr/bin/basename/usr/bin/cat/usr/bin/chcon/usr/bin/chgrp/usr/bin/chmod/usr/bin/chown/usr/bin/cksum/usr/bin/comm/usr/
2021-01-14 22:19:26 743
原创 centos----coreutils中的sort -k 的意思是key
-k, --key=KEYDEF sort via a key; KEYDEF gives location and type\n\
2021-01-14 22:14:19 213
原创 centos---ssh之客户端known_hosts的作用是保存服务端的公key
ssh之客户端known_hosts的作用是保存服务端的公key[root@VM-0-12-centos dropbear-2020.80]# ./dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_keyGenerating 2048 bit rsa key, this may take a while...Public key portion is:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUc.
2021-01-14 07:13:19 1281
原创 centos----只需三条命令利用iptables和ipset长期封禁ip和临时封禁ip
iptables和ipset长期封禁ip和临时封禁ip[root@centos xxxx]# ipset create blacknow hash:ip[root@centos xxxx]# iptables -I INPUT -m set --match-set blacknow src -j DROP[root@centos xxxx]# lastb -n 2000 | awk '{ print $3 }'|sort |uniq -c |sort -nr|head -n 60|awk '{ pri
2021-01-12 09:47:17 386
原创 centos----grep自己单独的一个软件包,包括egrep,fgrep和grep三个命令
grep自己单独的一个软件包,包括egrep,fgrep和grep三个命令[xxxxxx@centos xxxxxx]# rpm -qa|grep grepgrep-3.1-6.el8.x86_64[xxxxxx@centos xxxxxx]# rpm -ql grep|head -n 20/etc/GREP_COLORS/etc/profile.d/colorgrep.csh/etc/profile.d/colorgrep.sh/usr/bin/egrep/usr/bin/fgrep/
2021-01-12 08:36:16 279
原创 centos----tftpd配置
tftp-server-0.49-7.el6.x86_64centos配置tftpd# default:off# description: The tftp server serves files using the trivial file transfer # protocol. The tftp protocol is often used to boot diskless # workstations, download configuration files t...
2021-01-04 11:09:27 236
原创 centos----windows的ftp匿名登录输入什么用户名和密码
anonymous和ftp,密码可以不输入。[root@admin]# ftp 172.2.6.15Connected to 172.2.6.15 (172.2.6.15).220 Microsoft FTP ServiceName (172.2.6.15:root): ftp331 Anonymous access allowed, send identity (e-mail name) as password.Password:230 User logged in.Remote sys
2021-01-03 16:13:03 1479
原创 centos---软件centos-release-8.0-0.1905.0.9.el8.x86_64和变量$releasever的关系
软件centos-release-8.0-0.1905.0.9.el8.x86_64和变量$releasever的关系rpm -qi centos-releaseName : centos-releaseVersion : 8.0Release : 0.1905.0.9.el8Architecture: x86_64Install Date: 2019年11月26日 星期二 10时12分10秒Group : System Environm...
2021-01-02 21:57:01 1086 1
原创 centos----centos-6.7--yum安装gcc4.4.7-16成功
rpm -ivh libxml2-python-2.7.6-14.el6.x86_64.rpmrpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpmrpm -ivh createrepo-0.9.9-18.el6.noarch.rpmcreaterepo /opt/admin/c67/rm /opt/admin/c67/TRANS.TBLcentos-6.7--yum安装gcc4.4.7-16成功[root@RCD c6.
2021-01-02 15:31:59 1136
原创 centos---gcc-4.4.7-4rpm包在centos6.5里面
gcc-4.4.7-4rpm包在centos6.5里面gcc-4.4.7-4.el6.i686.rpmcentos 6.5centos 6.7
2021-01-01 19:41:11 260
原创 拷贝兔ajax上传和返回tag函数分析
拷贝兔ajax上传和返回tag函数分析 function multipartUploadWithSts(file,burn) { $("#select_file").hide(); $("#uploading").show(); console.log("file=",file); var formData = new FormData(); formData.append("file",file); f...
2020-12-21 16:16:54 237
原创 php----Index.php中上传文件移动文件的源代码调试分析
controller/Index.php $file = request()->file('file'); $fileInfo = $file->getInfo(); $fp = fopen('./a.txt', 'a+b'); fwrite($fp, print_r($fileInfo, true)); fclose($fp);上面自己添加的四行调...
2020-12-21 15:48:01 367
原创 php----拷贝兔中选择文件按钮的upload_with_input事件
拷贝兔中选择文件按钮的upload_with_input事件view/index/index.html<div class="fileBox" draggable='true' ondragstart="drag(event)" ondrop="drop(event)" ondragover="allowDrop(event)"><span id="fileSpan">拖拽到该区域</span><p id="uploadfile"></p>
2020-12-21 14:56:16 181
原创 如何查找自己的微信公众号主页并复制链接
如何查找自己的微信公众号主页并复制链接随意复制你微信公众号的一篇文章链接在浏览器打开查看源代码找到biz=*****编码,例如biz=MzUwOTg2MzgyMwhttps://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUwOTg2MzgyMw==&scene=117#wechat_redirect将 biz= 后面的*****编码替换成你刚才获取你自己公号的 openid,就可以获取到你公众号的主页链接啦...
2020-12-08 10:42:41 4831
原创 linux----利用ifconfig和grep和tr得到网卡地址
利用ifconfig和grep和tr得到网卡地址[xxxxxxxx@VM-0-12-centos ~]$ ifconfig eth0 | grep netmask inet 172.21.0.12 netmask 255.255.240.0 broadcast 172.21.15.255[xxxxxxxx@VM-0-12-centos ~]$ ifconfig eth0 | grep netmask | tr -s " "inet 172.21.0.12 netmask 255....
2020-12-07 16:44:05 634
TUTORIAL FOR INSTALLING MINIX-386
2013-12-14
netcat.dll(UDP版) by chenghao0511
2013-05-20
netcat 1.15-3 by chenghao0511
2013-05-16
netcat 1.15-2 by chenghao0511
2013-05-14
netcat 1.142 by chenghao0511
2013-05-05
netcat 1.14 by chenghao0511
2013-05-03
samba rpm包 for centos-5.5
2013-03-25
bash 1.05 by gcc-1.40 in minix-386 第二版
2013-02-23
fdisk-by-chenghao0511 for linux-0.11
2013-02-16
readinode for linux-0.11 by chenghao0511
2013-02-15
readblock for linux-0.11 by chenghao0511
2013-02-15
isbn十位转13位.xlsx
2020-05-09
cute http file server 开发API
2018-11-01
Prime numbers and the Riemann zeta function.by Jørgen Veisdal
2018-03-27
initramfs-tools_0.103
2015-01-29
linux-0.11硬盘集成盘14年1月9日by chenghao0511
2014-01-09
调试shoelace的winiboot所需的img文件
2014-01-08
readline used in linux-0.11 made in minix
2014-01-04
linux-0.11内核文件备份
2014-01-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人