aboutsummaryrefslogtreecommitdiff
path: root/findutils/Config.src (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-11-08dd: fix overflow for very large count/seek/skip valuesDenys Vlasenko2-9/+7
function old new delta xatoull_range_sfx - 49 +49 dd_main 1607 1640 +33 bb_banner 47 46 -1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 82/-1) Total: 81 bytes Signed-off-by: Sertonix <sertonix@posteo.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-11-08pgrep/pkill: fix -x to also match comm fieldDenys Vlasenko1-4/+4
When running `pgrep -x example` against a process `/bin/example --arg`, BusyBox fails to match, while GNU pgrep succeeds. The reason is that the comparison is done only against the full argv[0] rather than comm. This patch changes pgrep -x to also try /proc/[pid]/comm for exact matching. function old new delta pgrep_main 681 670 -11 Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-11-08ls: restore functionality of --colorDenys Vlasenko1-1/+1
Since commit 551bfdb97 (ls: implement -q, fix -w0, reduce startup time) the '--color' option behaves as though the default argument 'always' had been specified. This is due to an explicit short option for '--color' being given, but without specifying that an argument is expected. function old new delta .rodata 106027 106029 +2 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-11-08lineedit: fix PS1='\W' for root directoryDenys Vlasenko1-1/+1
'\W' in PS1 returned an empty string for the root directory. bash displays '/' in similar circumstances. Avoid returning an empty string for the directory. function old new delta parse_and_put_prompt 873 883 +10 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-11-08last: fix ignoring the first login entryDenys Vlasenko1-1/+1
The first login entry is ignored if a log file contains more than one entry. To fix it, do not break the while loop if the offset is zero. Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-13busybox: optional --version supportDenys Vlasenko2-4/+19
function old new delta busybox_main 695 734 +39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-11ntpd: set tmx.maxerror properly - avoid STA_UNSYNCDenys Vlasenko1-5/+12
function old new delta update_local_clock 872 951 +79 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-08nsenter,unshare: don't use xvfork_parent_waits_and_exits(), it SEGVs on ppc64leDenys Vlasenko3-2/+25
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-07cp: fix `cp -aT` overwriting symlink to directoriesDenys Vlasenko1-1/+2
busybox cp refuses to overwrite another symlink to a directory due to an incorrect stat() call that should be lstat(). When using -T, we want to consider the target argument directly without resolving symlinks. function old new delta cp_main 496 514 +18 Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-07chrt: support passing `-p 0` to operate on selfDenys Vlasenko1-3/+10
Specifying a PID of 0 for the -p option of chrt would previously result in a "number 0... not in range" error. Now, it means instead that the calling process (i.e. chrt itself) should be operated on; this is to be consistent with the behavior of util-linux's version of chrt. function old new delta chrt_main 462 474 +12 Signed-off-by: Zuo An <zuoan.penguin@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-07selinux: fix potential segfault in sestatusDenys Vlasenko1-2/+2
Remove the puts(cterm) call that was likely leftover debugging code. The controlling terminal name is already properly displayed via the 'Controlling term:' label, so the raw terminal name output was redundant and could cause issues when cterm is NULL. Also add proper cleanup for the allocated cterm string. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-10-07vi: warn about range in ':!' commandDenys Vlasenko1-0/+4
Currently vi in Busybox doesn't support filtering text through an external command with ':1,2!cmd'. Instead it behaves as if no range had been supplied and displays the output of the command. Issue a warning and do nothing in such cases. function old new delta colon 3993 4010 +17 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-09-24archival/libarchive: sanitize filenames on output (prevent control sequence ↵Denys Vlasenko2-3/+3
attacks This fixes CVE-2025-46394 (terminal escape sequence injection) Original credit: Ian.Norton at entrust.com function old new delta header_list 9 15 +6 header_verbose_list 239 244 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 11/0) Total: 11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-09-23ash: change procargs() to match recent dash changeDenys Vlasenko1-7/+3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-09-03hush: changes to comments and whitespace, no code changesDenys Vlasenko1-8/+8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-09-02ash: implement <<<here_string syntaxDenys Vlasenko3-26/+129
function old new delta write2pipe - 133 +133 .rodata 105992 106009 +17 readtoken1 3101 3111 +10 cmdtxt 631 641 +10 nodesize 27 28 +1 redirect 961 916 -45 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/1 up/down: 171/-45) Total: 126 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-18hush: fix several syntax corner cases with function definitionsDenys Vlasenko9-2/+37
function old new delta parse_stream 3063 3075 +12 done_word 777 784 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 19/0) Total: 19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-18hush: shrink "function" codeDenys Vlasenko1-11/+11
function old new delta done_word 766 777 +11 static.reserved_match 16 12 -4 reserved_list 240 168 -72 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 11/-76) Total: -65 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-18hush: do not SEGV on if { echo foo; } then { echo bar; } fiDenys Vlasenko1-5/+4
For some reason, it was only happening in interactive use function old new delta initialize_context 39 54 +15 parse_stream 3077 3063 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 15/-14) Total: 1 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-18hush: disentangle keyword detection, no logic changesDenys Vlasenko1-25/+27
function old new delta done_word 790 766 -24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: make "function" keyword support optionalDenys Vlasenko1-11/+22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: with --login, errors /etc/profile in must not exit shellDenys Vlasenko1-3/+8
function old new delta die_if_script 28 34 +6 hush_main 1146 1150 +4 run_list 1031 1028 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 10/-3) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: recognize "function FUNC { cmd; }" syntaxDenys Vlasenko1-43/+103
function old new delta reserved_list - 240 +240 parse_stream 2923 3077 +154 done_word 771 790 +19 .rodata 105975 105992 +17 static.reserved_match 12 16 +4 static.reserved_list 168 - -168 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 4/0 up/down: 434/-168) Total: 266 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: remove always-true conditionalDenys Vlasenko1-1/+0
function old new delta parse_stream 2940 2923 -17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: fix infinite loop expanding alias a="nice&&a"Denys Vlasenko1-6/+45
function old new delta parse_stream 2857 2940 +83 i_peek 55 69 +14 i_free_alias_buffer 33 37 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 101/0) Total: 101 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: comment fixesDenys Vlasenko1-2/+1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: make "alias" print aliases in properly escaped formDenys Vlasenko1-31/+21
function old new delta print_pfx_escaped_nl - 83 +83 builtin_alias 216 218 +2 .rodata 105985 105975 -10 parse_stream 2873 2857 -16 builtin_set 301 259 -42 builtin_readonly 107 59 -48 builtin_export 145 93 -52 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/5 up/down: 85/-168) Total: -83 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: fix nested alias expansionDenys Vlasenko1-5/+10
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-17hush: optional alias supportDenys Vlasenko1-44/+388
function old new delta parse_stream 2540 2873 +333 i_getch 85 410 +325 builtin_alias - 216 +216 builtin_unalias - 185 +185 .rodata 105806 105985 +179 word_matches_alias - 82 +82 find_alias_slot - 77 +77 end_of_alias_name - 69 +69 builtin_type 128 179 +51 i_free_alias_buffer - 33 +33 enable_all_aliases - 29 +29 bltins1 396 420 +24 o_reset_to_empty_unquoted - 21 +21 run_pipe 1554 1566 +12 i_peek 57 55 -2 parse_redirect 351 346 -5 redirect_opt_num 63 53 -10 encode_then_append_var_plusminus 552 532 -20 done_word 796 771 -25 i_getch_interactive 308 - -308 ------------------------------------------------------------------------------ (add/remove: 8/1 grow/shrink: 6/5 up/down: 1636/-370) Total: 1266 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-16hush: optimization in set_local_var()Denys Vlasenko1-6/+6
function old new delta set_local_var 416 409 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-15hush: implement <<<here_string syntaxDenys Vlasenko3-41/+137
function old new delta setup_heredoc 299 351 +52 parse_stream 2514 2540 +26 parse_redirect 335 351 +16 redir_table 40 48 +8 static.setup_redirects 394 400 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 108/0) Total: 108 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: allow faster parsing for "./:@" charactersDenys Vlasenko1-2/+7
function old new delta parse_stream 2513 2514 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: shrink syntax error handlingDenys Vlasenko1-28/+52
Was trying to add code to reject more invalid "case" syntaxes, but it's not that easy function old new delta done_word 795 796 +1 parse_stream 2529 2513 -16 .rodata 105825 105806 -19 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 1/-35) Total: -34 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: undo incorrect change which allows a'b'=c to be assignmentDenys Vlasenko5-22/+20
While at it, remove now-unused WORD_IS_KEYWORD Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: explain "empty quoted str marker" trickDenys Vlasenko1-5/+11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: improve code readability, no logic changesDenys Vlasenko1-22/+25
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: move tickquote1.tests to hush-bugs/ - it's a known bugDenys Vlasenko2-0/+0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: remove the is_blank danceDenys Vlasenko5-76/+75
function old new delta parse_stream 2566 2524 -42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-14hush: remove two strchr's from the hottest parsing loopDenys Vlasenko1-88/+85
function old new delta parse_stream 2572 2566 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-13hush: optimize decoding of $'str' - avoid extra function call if we canDenys Vlasenko1-5/+4
function old new delta parse_stream 2565 2572 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-13hush: shrink i_getch, rename two functionsDenys Vlasenko1-28/+23
Final link with: <none> function old new delta i_getch_interactive - 308 +308 i_getch 102 85 -17 fgetc_interactive 309 - -309 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/1 up/down: 308/-326) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-13hush: ~5% faster parsing of typical shell scriptsDenys Vlasenko1-13/+19
0-9,A-Z,a-z are never special and just go into the current word. function old new delta parse_stream 2476 2565 +89 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-13hush: create a macro IS_NULL_WORD to test for null shell wordDenys Vlasenko1-16/+14
No logic changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-13hush: fix a corner case in "case" stmt, ctx_dsemicolon is in fact unusedDenys Vlasenko5-53/+55
function old new delta parse_stream 2446 2476 +30 done_word 797 800 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-12hush: allow nested negation "! ! ! CMD" - bash 5.2.15 allows itDenys Vlasenko3-73/+71
Also, deindent "ch == EOF" code branch in parse_stream() function old new delta done_word 799 797 -2 parse_stream 2453 2446 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-9) Total: -9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-12hush: drop ctx_inverted, use pipe->pi_invertedDenys Vlasenko2-20/+25
function old new delta done_word 776 799 +23 parse_stream 2456 2453 -3 done_pipe 252 242 -10 .rodata 105837 105825 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 23/-25) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-12hush: do not segfault on "for </dev/null v in..."Denys Vlasenko3-113/+124
This is not accepted by bash, we may also disallow this, but for now, at least do not crash Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-11hush: test for, and disallow several invalid syntaxesDenys Vlasenko21-25/+96
function old new delta parse_stream 2292 2456 +164 done_pipe 231 252 +21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 185/0) Total: 185 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-11ash: parser: Invalid redirections are run-time, not syntax errorsDenys Vlasenko1-1/+1
Upstream commit Date: Wed, 14 Dec 2022 02:06:05 +0100 parser: Invalid redirections are run-time, not syntax errors This fixes a long-standing bug where echo 'echo >&a' | sh errors out with sh: 2: Syntax error: Bad fd number despite the error being on line 1 This patch makes the error sh: 1: Bad fd number: a as expected Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-11hush: fix var_backslash1.testsDenys Vlasenko5-68/+138
function old new delta o_addqblock - 131 +131 append_str_maybe_ifs_split 53 100 +47 expand_one_var 1872 1897 +25 encode_then_expand_vararg 380 399 +19 sig_unblock 41 43 +2 sig_block 41 40 -1 sigprocmask_allsigs 33 31 -2 expand_vars_to_list 1080 1077 -3 wait_for_child_or_signal 202 193 -9 o_addQstr 175 42 -133 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/5 up/down: 224/-148) Total: 76 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>