aboutsummaryrefslogtreecommitdiff
path: root/scripts/find_stray_empty_lines (unfollow)
Commit message (Collapse)AuthorFilesLines
8 dayswin32: add support for /dev/std{in,out,err}Ron Yorston2-5/+18
Allow applets to open the "files" /dev/stdin, /dev/stdout and /dev/stderr. The 'stat' and 'ls' applets pretend they exist. Adds 48-56 bytes.
9 dayslibbb: fix regression where 'which' output duplicate slashesRon Yorston1-0/+8
If an element of $PATH had a trailing slash 'which' displayed two slashes when an executable was found in that directory. This is a regression caused by upstream commit 49d9e06fb (libbb: modify find_executable() to not temporarily write to PATH). Prior to this commit find_executable() used concat_path_file() to build the path of the executable. This avoids including duplicate slashes in its output. The new code didn't. Add a test in find_executable() to detect the problem. It still fails if there are multiple trailing slashes. Don't do that. Adds 48 bytes.
11 daysash: remove unnecessary conditional compilationRon Yorston1-4/+0
Additional support for background jobs was added in commits 010abea6f and 1403d81c4. The condition ENABLE_PLATFORM_POSIX || JOBS_WIN32 in showjob() is always true. The conditional compilation can be removed.
12 daysash: don't skip exec() if std streams are invalidRon Yorston1-1/+3
This didn't produce the expected output when run from ash: ash -c "echo abc | sed s/a/x/" <&- In general, if the last command in the pipe read from stdin the command didn't work; if it read from file descriptor 0 (e.g. cat) it did. Closing a file descriptor caused the corresponding stream to become invalid. For performance reasons the shell in busybox-w32 runs applets without an exec(), but that results in their seeing the invalid stream from their parent. Avoid the problem by calling exec() in such cases. This causes the child process to get a new stdin stream initialised from the file descriptor. The test also applies to stdout and stderr. There's no discernable affect on performance when running the test suite. Adds 64-96 bytes. (GitHub issue #558)
13 daysash: fix \ooo octal printout in DEBUG codebusyboxDenys Vlasenko1-16/+12
function old new delta ash_main 1624 1645 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 daysash: code shrink: eliminate pstrcmp1()Denys Vlasenko1-66/+63
function old new delta find_command 961 963 +2 evalcommand 1631 1633 +2 hashcmd 299 300 +1 describe_command 320 321 +1 clearcmdentry 93 94 +1 cdcmd 695 696 +1 pstrcmp1 16 - -16 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 6/0 up/down: 8/-16) Total: -8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 dayslibbb: code shrinkRon Yorston2-16/+30
Fix some compiler warnings and move the CNG algorithm caches into get_alg_handle(). Saves 32 bytes in the x86_64 build with CNG enabled.
13 dayslibbb: update CNG API config messagerfl8901-2/+3
13 daysash: remove non-standard chdir builtinDenys Vlasenko1-17/+14
function old new delta .rodata 106853 106846 -7 builtintab 352 344 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-15) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 daysash: get rid of a static in cmdlookup()/delete_cmd_entry()Denys Vlasenko1-26/+38
function old new delta cmdlookup_pp - 120 +120 find_command 953 961 +8 unsetcmd 74 76 +2 hashcmd 297 299 +2 lastcmdentry 4 - -4 delete_cmd_entry 47 43 -4 cmdlookup 132 - -132 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 3/1 up/down: 132/-140) Total: -8 bytes text data bss dec hex filename 47470 8 149 47627 ba0b shell/ash.o.orig 47466 8 145 47619 ba03 shell/ash.o Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 daysash: group command hashing/searching code together, no code changesDenys Vlasenko1-346/+351
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 daysash: move casematch() directly to its only caller, no code changesDenys Vlasenko1-31/+36
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 daysash: reorder functions to reduce forward declarations, no code changesDenys Vlasenko1-165/+156
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 dayslibbb: refactor CNG hashing implementationrfl8904-47/+110
The existing CNG implementation relied on multiple features only implemented in "newer" Windows versions. This new implementation does not use the aforementioned features and is therefore compatible with systems running Windows Vista or higher. function old new delta .rdata 87112 87288 +176 hmac_peek_hash 80 208 +128 get_alg_handle - 96 +96 algorithm_provider_hmac_cache - 48 +48 algorithm_provider_cache - 48 +48 alg_id_mappings - 48 +48 sha512_begin 16 48 +32 sha384_begin 16 48 +32 sha256_begin 16 48 +32 sha1_begin 16 48 +32 md5_begin 16 32 +16 hmac_hash_v 48 64 +16 hmac_end 48 64 +16 hmac_blocks.constprop.0 96 112 +16 __imp_BCryptOpenAlgorithmProvider - 8 +8 __imp_BCryptDuplicateHash - 8 +8 BCryptOpenAlgorithmProvider - 8 +8 BCryptDuplicateHash - 8 +8 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 10/0 up/down: 768/0) Total: 768 bytes
14 daysash: JOBSTOPPED can only be set if job control is compiled in - ↵Denys Vlasenko1-2/+13
conditionalize code which depends on it With !ASH_JOB_CONTROL: function old new delta cmdloop 363 351 -12 exitcmd 47 31 -16 .rodata 106422 106398 -24 stoppedjobs 58 - -58 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/3 up/down: 0/-110) Total: -110 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 daysash: reorder functions to reduce forward declarations, no code changesDenys Vlasenko1-450/+453
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 daysash: move applet handling out of tryexec() - making it similar to dashDenys Vlasenko1-62/+61
function old new delta tryexec - 60 +60 shellexec 476 349 -127 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 60/-127) Total: -67 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 daysdoc: update docs/nofork_noexec.txtDenys Vlasenko1-1/+6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
14 daysash: unset traps before entering NOEXEC programs after [v]forkDenys Vlasenko1-7/+89
If we don't do that, if INT trap was set, ^C will set a flag "run trap later" and _return_, which is not expected by the NOFORK! function old new delta clear_traps - 107 +107 evalcommand 1617 1631 +14 shellexec 471 476 +5 setsignal 333 327 -6 forkchild 620 480 -140 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/2 up/down: 126/-146) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-26make: bring into alignment with pdpmakeRon Yorston1-2/+3
The make applet is based on code from pdpmake. Make a few minor adjustments to bring the two into line. The only one of any significance is setting 'target' to NULL in docmds(). Adds 16 bytes.
2026-01-26httpd: optimize example CGIsDenys Vlasenko2-37/+25
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-26libbb/loop: fix existence check for LOOP_CONFIGURE ioctlWouter Franken1-1/+1
The LOOP_CONFIGURE ioctl is supported in 5.8 kernels and up. To have backwards compatibility there is a config option CONFIG_TRY_LOOP_CONFIGURE that will check if the ioctl exists and if not fall back to old way of configuring loop devices. Normally errno will be set to EINVAL when this ioctl does not exist. However, when kernel config CONFIG_COMPAT is enabled, then compat_ioctl is called. In that case -ENOIOCTLCMD is returned by loop device driver and generic ioctl wrapper will set errno to ENOTTY. Because busybox does not expect this it will fail to mount loop devices in this case. This patch fixes the check for the existence of the ioctl LOOP_CONFIGURE by checking if errno is one of both: EINVAL or ENOTTY. function old new delta set_loop 809 821 +12 Signed-off-by: Wouter Franken <wouter.franken_ext@softathome.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-26networking/httpd_indexcgi.c: non-mallocing versionDenys Vlasenko2-108/+200
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-25httpd: add a TODO, no code changesDenys Vlasenko1-0/+3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24ash: code shrinkDenys Vlasenko1-0/+4
function old new delta fg_bgcmd 294 296 +2 killpg 43 - -43 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 1/0 up/down: 2/-43) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24httpd: allow static files in /cgi-bin/, do not search for interpreter twiceDenys Vlasenko1-24/+25
function old new delta handle_incoming_and_exit 2270 2334 +64 send_cgi_and_exit 790 754 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 64/-36) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24ash,hush: allow 0x in arith (bash supports it for 0x$v case when v='')Denys Vlasenko1-5/+13
function old new delta parse_with_base 174 196 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24httpd: code shrinkDenys Vlasenko1-18/+22
function old new delta send_file_and_exit 931 933 +2 get_line 126 120 -6 httpd_main 968 959 -9 send_headers 708 694 -14 handle_incoming_and_exit 2285 2270 -15 cgi_io_loop_and_exit 635 620 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/5 up/down: 2/-59) Total: -57 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24awk: use more understandable form of "split-globals" trickDenys Vlasenko2-39/+36
function old new delta parse_expr 986 998 +12 chain_group 633 640 +7 next_token 930 934 +4 getvar_s 102 101 -1 awk_main 891 888 -3 evaluate 3379 3355 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/3 up/down: 23/-28) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24httpd: code shrink via "split-globals" trickDenys Vlasenko2-3/+18
function old new delta httpd_main 957 968 +11 log_and_exit 25 26 +1 send_headers 712 708 -4 handle_incoming_and_exit 2292 2285 -7 sigalrm_handler 102 93 -9 parse_conf 1332 1323 -9 send_cgi_and_exit 803 790 -13 cgi_io_loop_and_exit 656 635 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/6 up/down: 12/-63) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-24httpd: implement POSTDATA read timeout, and -K KILLSECS CGI lifetime controlDenys Vlasenko1-59/+110
function old new delta cgi_io_loop_and_exit 496 656 +160 sigalrm_handler 1 102 +101 .rodata 106814 106853 +39 send_cgi_and_exit 770 803 +33 packed_usage 35894 35924 +30 httpd_main 950 957 +7 handle_incoming_and_exit 2297 2292 -5 send_REQUEST_TIMEOUT_and_exit 10 - -10 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 6/1 up/down: 370/-15) Total: 355 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-23join: add some more testsRon Yorston2-1/+31
One more from the POSIX documentation and some examples from coreutils.
2026-01-23httpd: fix incorrect == comparison in last commit, must be !=Denys Vlasenko1-1/+3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-23httpd: smarter handling of CGI's "Status: " headerDenys Vlasenko1-10/+13
Do one less write() function old new delta handle_incoming_and_exit 2290 2297 +7 cgi_io_loop_and_exit 498 500 +2 .rodata 106821 106814 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 9/-7) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-23httpd: simplify CGI headers handling, check "HTTP/1.1" prefix, not just "HTTP"Denys Vlasenko2-28/+32
function old new delta cgi_io_loop_and_exit 477 498 +21 .rodata 106830 106821 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 21/-9) Total: 12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-23httpd: simplify CGI code a bit, add a bunch of TODOs and FIXMEsDenys Vlasenko2-29/+37
function old new delta log_and_exit 33 25 -8 handle_incoming_and_exit 2298 2290 -8 send_cgi_and_exit 784 770 -14 cgi_io_loop_and_exit 538 477 -61 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-91) Total: -91 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: do not force clean connection termination on write errors and timeoutsDenys Vlasenko1-24/+45
function old new delta send_file_and_exit 891 931 +40 send_EOF_and_exit - 14 +14 cgi_io_loop_and_exit 535 538 +3 log_and_exit 44 33 -11 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 57/-11) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: make timeout messages less confusingDenys Vlasenko1-6/+10
function old new delta send_file_and_exit 891 930 +39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: time out data writes after 60 seconds of no progressDenys Vlasenko1-13/+45
function old new delta prepare_write_timeout - 29 +29 static.tv - 16 +16 httpd_main 939 950 +11 send_file_and_exit 887 891 +4 handle_incoming_and_exit 2306 2298 -8 cgi_io_loop_and_exit 552 535 -17 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/2 up/down: 60/-25) Total: 35 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: optimize header reading timeout codeDenys Vlasenko1-4/+10
Set up the signal handler once, outside of main loop. Do not reset the timer if headers are big - they still are expected to arrive quickly. function old new delta httpd_main 913 939 +26 handle_incoming_and_exit 2312 2306 -6 get_line 134 126 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 26/-14) Total: 12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: when reading headers, abort if they are too longDenys Vlasenko1-7/+9
function old new delta get_line 130 134 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: reject request line and headers with control charsDenys Vlasenko1-0/+12
This removes the need to check various corner cases later. function old new delta get_line 108 130 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: allow http2 requests if proxying, tighten METHOD checksDenys Vlasenko1-9/+16
function old new delta handle_incoming_and_exit 2264 2312 +48 httpd_main 915 913 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-2) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22Update default configurationsRon Yorston5-6/+11
2026-01-22httpd: fix compilation script of httpd_ratelimit_cgi.cDenys Vlasenko2-2/+4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-22httpd: add -M MAXCONN - do not accept unlimited number of connectionsDenys Vlasenko1-19/+86
We were lacking even basic rate-limiting. function old new delta httpd_main 648 915 +267 handle_incoming_and_exit 2235 2264 +29 packed_usage 35868 35894 +26 cgi_io_loop_and_exit 537 552 +15 send_headers 704 712 +8 get_line 106 108 +2 .rodata 106829 106830 +1 send_file_and_exit 890 887 -3 mini_httpd 161 - -161 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/1 up/down: 348/-164) Total: 184 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-21httpd: stop disabling/enabling SIGHUP in every childDenys Vlasenko1-8/+13
function old new delta sighup_handler 30 47 +17 httpd_main 710 695 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 17/-15) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-21httpd: remove one close() from main loopDenys Vlasenko1-5/+6
function old new delta httpd_main 701 710 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-21networking/httpd_ratelimit_cgi.c: new example CGI handlerDenys Vlasenko2-1/+248
text data bss dec hex filename 4003 40 352 4395 112b httpd_ratelimit_cgi Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-21httpd: expand logging: now can see what CGIs are startedDenys Vlasenko1-26/+45
function old new delta send_cgi_and_exit 711 784 +73 vmstat_main 657 708 +51 .rodata 106746 106778 +32 send_file_and_exit 877 887 +10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 166/0) Total: 166 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>