aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* nameif: make it NOEXECDenys Vlasenko2017-08-063-3/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Tweak outdated documentation and commentsDenys Vlasenko2017-08-063-35/+37
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tunctl: make it NOEXECDenys Vlasenko2017-08-062-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kbd_more: make it NOEXEC, remove redundant opt clearingDenys Vlasenko2017-08-061-3/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kbd_mode: try harder to find console device if -C TTY is not givenDenys Vlasenko2017-08-062-9/+14
| | | | | | | | | | | | | | | | | | | | Was (under X): $ ./busybox_old kbd_mode kbd_mode: ioctl 0x4b44 failed: Inappropriate ioctl for device Now: $ ./busybox kbd_mode The keyboard is in off mode function old new delta kbd_mode_main 166 174 +8 packed_usage 31782 31764 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 8/-18) Total: -10 bytes text data bss dec hex filename 915757 485 6880 923122 e15f2 busybox_old 915747 485 6880 923112 e15e8 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kbd_mode: show "off" mode tooDenys Vlasenko2017-08-061-2/+16
| | | | | | | function old new delta kbd_mode_main 156 166 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lspci,lsscsi,lsusb: make them NOEXECDenys Vlasenko2017-08-054-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* umount: make it NOEXECDenys Vlasenko2017-08-052-2/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pstree: make it NOEXECDenys Vlasenko2017-08-053-15/+16
| | | | | | While at it, documet why ps can't be NOEXEC. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chattr,lsattr,tune2fs: make them NOEXECDenys Vlasenko2017-08-054-6/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chattr: fix option parsing to accept more cryptic option combosDenys Vlasenko2017-08-051-35/+51
| | | | | | | | function old new delta chattr_main 286 289 +3 packed_usage 31793 31761 -32 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sysctl: make it NOEXECDenys Vlasenko2017-08-052-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sysctl: recognize ";comment" and "<whitespace>#comment" linesDenys Vlasenko2017-08-053-5/+19
| | | | | | | function old new delta config_read 639 699 +60 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make trim() return pointer to terminating NULDenys Vlasenko2017-08-055-12/+22
| | | | | | | | | | | function old new delta trim 80 90 +10 angle_address 56 50 -6 sysctl_main 282 273 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: +10/-15) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sysctl: fix file parsing, do not require -w for VAR=VALDenys Vlasenko2017-08-054-32/+77
| | | | | | | | | | | | | function old new delta sysctl_act_on_setting - 451 +451 sysctl_main 222 282 +60 packed_usage 31744 31793 +49 config_read 604 639 +35 sysctl_act_recursive 612 163 -449 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/1 up/down: 595/-449) Total: 146 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cryptpw, mkpasswd: make them NOEXECDenys Vlasenko2017-08-052-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chvt, deallocvt, dumpkmap, fgconsole, loadkmap: make them NOEXECDenys Vlasenko2017-08-056-10/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pivot_root: make it NOFORKDenys Vlasenko2017-08-052-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* partprobe: make it NOEXECDenys Vlasenko2017-08-052-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sv, svc: make them NOEXECDenys Vlasenko2017-08-052-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* svc: fix a case where with more than option, getopt() state is not resetDenys Vlasenko2017-08-051-5/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* blockdev, fsfreeze, fstrim, mountpoint: make NOEXECDenys Vlasenko2017-08-055-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: use _exit, not exit, in bb_daemonize_or_rexec()Denys Vlasenko2017-08-046-15/+22
| | | | | | | | | By the time we reach exit in parent, child already exited or execed. We should not re-run libc cleanup code. While at it, introduce bb_daemon_helper() and add a few comments. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* stty: make in NOEXECDenys Vlasenko2017-08-042-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make 17 state-changing execing applets (ex: "nice PROG ARGS") noexecDenys Vlasenko2017-08-0412-43/+44
| | | | | | | | | | | | | | | | | | | | The applets with "<applet> [opts] PROG ARGS" API very quickly exec another program, noexec is okay for them: chpst/envdir/envuidgid/softlimit/setuidgid chroot chrt ionice nice nohup setarch/linux32/linux64 taskset cttyhack "reset" and "sulogin" applets don't have this form, but also exec another program at once, thus made noexec too. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mesg: make in NOFORKDenys Vlasenko2017-08-042-26/+31
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pmap: tweak help text, show usage if no params are givenDenys Vlasenko2017-08-042-31/+32
| | | | | | | | | | Noticed while auditing nofork/noexec status function old new delta pmap_main 70 80 +10 packed_usage 31747 31744 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runlevel: make it NOEXECDenys Vlasenko2017-08-042-20/+20
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mktemp: make it NOEXECDenys Vlasenko2017-08-042-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chat: trim help textDenys Vlasenko2017-08-043-47/+58
| | | | | | | | | Noticed while auditing nofork/noexec status function old new delta packed_usage 31777 31747 -30 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* getopt32: move support for "always treat first arg as option" to users (tar/ar)Denys Vlasenko2017-08-043-36/+10
| | | | | | | | | | | | | Now getopt() never leaks (and never performs) any xmalloc's. function old new delta ar_main 522 556 +34 tar_main 986 1014 +28 getopt32 1458 1350 -108 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 62/-108) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* getopt32: factor out code to treat all args as optionsDenys Vlasenko2017-08-046-32/+41
| | | | | | | | | | | | | Working towards making getopt32() xmalloc-free function old new delta make_all_argv_opts - 58 +58 top_main 914 912 -2 getopt32 1517 1458 -59 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 58/-61) Total: -3 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak NOFORK_NOEXEC.lstDenys Vlasenko2017-08-041-9/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: BASH_XTRACEFD bashismDenys Vlasenko2017-08-041-0/+10
| | | | | | | | | Based on patch by Johannes Schindelin <johannes.schindelin@gmx.de> function old new delta evalcommand 1447 1500 +53 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: remove no-longer-used variableJohannes Schindelin2017-08-041-2/+0
| | | | | | | | | | | As of 035486c75 (ash: significant overhaul of redirect saving logic, 2017-07-31), the sv_pos variable is no longer used (just assigned to, with no further effect). Let's just remove it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: INT_OFF/INT_ON around run_nofork_applet()Denys Vlasenko2017-08-041-3/+19
| | | | | | | function old new delta evalcommand 1441 1447 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sheel: improve comments on signal handlingDenys Vlasenko2017-08-044-17/+45
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modutils: make them NOEXEC except depmodDenys Vlasenko2017-08-047-16/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* microcom: require exactly one non-optionDenys Vlasenko2017-08-041-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: add a fixme comment at run_nofork_appletDenys Vlasenko2017-08-031-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nofork: fix a bug uncovered by hush testsuite (forgotten fflush)Denys Vlasenko2017-08-032-1/+3
| | | | | | | function old new delta run_nofork_applet 280 287 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* getopt: make it NOEXECDenys Vlasenko2017-08-032-14/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* new NOFORKs: pwdx,kill[all5],ttysize,realpath,readlink NOEXECs: date,resizeDenys Vlasenko2017-08-0311-93/+106
| | | | | | | | | | function old new delta run_nofork_applet 258 280 +22 readlink_main 112 123 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: FEDORA_COMPAT option (so far only tweaks uname)Denys Vlasenko2017-08-032-1/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* new NOFORKs: clear, nproc, tty, uname, arch, unlink, whichDenys Vlasenko2017-08-037-8/+414
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: do not accept "if() { echo; }" function defDenys Vlasenko2017-08-025-17/+60
| | | | | | | | | | | | | | function old new delta parse_stream 2634 2692 +58 msg_and_die_if_script - 21 +21 syntax_error_unexpected_ch 41 46 +5 syntax_error_at 14 18 +4 die_if_script 31 28 -3 setup_redirects 319 308 -11 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/2 up/down: 88/-14) Total: 74 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* line editing: make read_line_input() not take timeout paramDenys Vlasenko2017-08-026-20/+30
| | | | | | | | | | | | | | | | | | It's almost always -1. function old new delta read_line_input 3902 3912 +10 new_line_input_t 24 31 +7 pgetc 583 585 +2 save_command_ps_at_cur_history 80 78 -2 read_line 76 74 -2 fgetc_interactive 246 244 -2 addLines 84 82 -2 doCommands 2226 2222 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 19/-12) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: make SIGINT handling visually less confusingDenys Vlasenko2017-08-021-3/+3
| | | | | | | | | | | | | | | | | | | | | $ echo $$ 18448 $ echo $? <wait here, run "kill -INT 18448" in other shell><press enter> <=== NOTHING?? $ That empty line does not look right. After this patch: $ echo $$ 18448 $ echo $? <wait here, run "kill -INT 18448" in other shell><press enter> ^C $ function old new delta fgetc_interactive 245 246 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* NOFORK fixesDenys Vlasenko2017-08-026-6/+48
| | | | | | | | | | | | | | | | | | "rm -i FILE" and "yes" can now be interrupted by ^C in hush. This also now works: $ usleep 19999999 ^C $ echo $? 130 function old new delta run_pipe 1668 1711 +43 pseudo_exec_argv 312 321 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 52/0) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* do not use `a' quoting style in commentsDenys Vlasenko2017-08-0235-42/+42
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>