Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
277 commits
Select commit Hold shift + click to select a range
175b8dd
libbb: tidy argument checks in getopt32()
rmyorston Nov 6, 2024
87e60dc
hexdump: fix regression with -n4 -e '"%u"'
ncopa Oct 28, 2024
50e2b59
cut: fix "-s" flag to omit blank lines
colin-pm Jul 17, 2024
f020414
cut: improve detection of invalid ranges
rmyorston Nov 3, 2024
73e9d25
cut: simplify OPT_ names, eliminate one variable
vda-linux Dec 10, 2024
ad12ab4
cut: localize 'spos' variable, convert !NUMVAR to NUMVAR == 0
vda-linux Dec 10, 2024
478ac90
cut: allocate "printed" only if OPT_CHAR or OPT_BYTE
vda-linux Dec 10, 2024
808155e
cut: "orig_line" is redundant, remove it
vda-linux Dec 10, 2024
1220b15
cut: rename some variables to hopefully better names
vda-linux Dec 10, 2024
55fc6a1
cut: rename "cut_lists" to "cut_list"
vda-linux Dec 10, 2024
470f009
cut: with -F, do not regcomp() pattern for every file
vda-linux Dec 10, 2024
103139d
cut: fix "echo 1.2 | cut -d. -f1,3" (print "1", not "1.")
vda-linux Dec 10, 2024
38a3c0a
cut: comment out code which seems to be not needed
vda-linux Dec 10, 2024
b402b13
cut: with -F disabled in .config, don't show it in --help
vda-linux Dec 10, 2024
a208fa0
cut: implement --output-delimiter
vda-linux Dec 10, 2024
9e364b1
cut: fix -d$'\n' --output-delimiter=@@ behavior
vda-linux Dec 10, 2024
a4894ea
cut: tweak --help
vda-linux Dec 11, 2024
9adafbc
cut: prevent infinite loop if -F REGEX matches empty delimiter
vda-linux Dec 13, 2024
96a230f
cut: fix handling of -d ''
vda-linux Dec 13, 2024
ed65616
cut: tweak comments
vda-linux Dec 13, 2024
f4f8dc6
cut: whitespace fixes
vda-linux Dec 13, 2024
7624077
cut: "it's legal to pass an empty list" seems to be untrue
vda-linux Dec 13, 2024
d48400d
cut: simplify getopt32 code
vda-linux Dec 13, 2024
b25ea3f
cut: fix -F n-m to match toybox
vda-linux Dec 14, 2024
e8622f0
cut: disallow -f '' and -f '-'
vda-linux Dec 15, 2024
ba9651b
cut: we can't get empty cut_list[], remove the check for that
vda-linux Dec 15, 2024
0bd84c9
cut: terminate cut_list[] so that we don't need "size of the array" v…
vda-linux Dec 15, 2024
ee8b94a
cut: shorten error messages on bad syntax
vda-linux Dec 15, 2024
e2304d4
cut: shorten error messages on bad syntax even more
vda-linux Dec 16, 2024
dd40b40
cut: remove unnecessary initialization of regmatch_t
vda-linux Dec 20, 2024
b03f516
cut: fix up -D/-s behavior with -F
vda-linux Dec 20, 2024
1ea89fa
cut: code shrink
vda-linux Dec 20, 2024
14f57f5
cut: code shrink
vda-linux Dec 20, 2024
ef21820
udhcpc6: improvements
Feb 9, 2025
779cca8
udhcpc6: move block comment, no code changes
vda-linux Feb 9, 2025
4115439
udhcpc6: generate a consistent IAID
PuzzleZz Feb 9, 2025
8872956
udhcpc6: fix copy-paste error in "generate a consistent IAID" commit
vda-linux Feb 9, 2025
f9274e8
init: improve log message when a process exits: show exit code
s-paris Apr 2, 2025
a8349b1
Makefile: fix passing of EXTRA_LDLIBS
vda-linux Apr 6, 2025
d2d23c8
udhcpd: send DHCPOFFERs as unicast (unless clients specifically asks …
vda-linux Apr 7, 2025
fc46672
syslogd: Fix 'OPT_locallog' check regression in 'syslogd_main'
gerickson Apr 8, 2025
9a87964
archival: disallow path traversals (CVE-2023-39810)
vda-linux Oct 2, 2024
636315c
runit: fix setuidgid help text
neuschaefer Apr 14, 2025
c61fdad
libbb/archival: make setup_unzip_on_fd() return bytes read if not com…
vda-linux Apr 20, 2025
f13f682
rpm2cpio: extract cpio even if compression is not known
vda-linux Apr 20, 2025
5f07327
cpio: error out if the file to be achived is >=4GB
vda-linux Apr 21, 2025
37abfb9
lineedit: fix printing lines during tab completion
a3f Apr 15, 2025
952a7b9
lineedit: fix left-over print to stdout
a3f Apr 15, 2025
58adc7b
ip route: make cache printing a bit more similar to upstream
vda-linux Jul 1, 2025
73c67d7
ntpd: Raise MAXDIST to 3s for better tolerance and consistency with c…
linkjumper Jun 17, 2025
f5c7cae
hexdump: fix regression for uint16 on big endian systems
radolin Apr 23, 2025
b8ce208
od: make -B test little endian only, add variant for big endian
radolin Apr 23, 2025
e6317e7
hexdump: add tests for %x, handle little/big endian properly
radolin Apr 23, 2025
4b1f1da
df: -k overrides block size to 1k even if $POSIXLY_CORRECT
vda-linux Jul 1, 2025
dcd8df2
shell: improve bash compatibility of read built-in
rmyorston Jul 1, 2025
244f5c4
libbb: Prevent clang from reading the G pointer before it is assigned
lbmeng Jun 1, 2025
8c83554
cpio: map -F to --file long option
sertonix Apr 8, 2025
bbaa56f
use pollfd[1] array for poll() argument
vda-linux Jul 2, 2025
36ac283
shell: fix race between signal handlers setting bb_got_signal and poll()
vda-linux Jul 2, 2025
9c46a06
shell: update HISTFILESIZE code to be actually useful
vda-linux Jul 3, 2025
8d3d078
shell: empty HISTFILE disables history saving, just as unset one did
vda-linux Jul 4, 2025
142ac2d
diff: code shrink
vda-linux Jul 4, 2025
8476671
whitespace fix
vda-linux Jul 5, 2025
80e6766
libbb: add yescrypt password hashing support
vda-linux Jul 5, 2025
444a91a
libbb/yescrypt: remove obviously unused, commented-out parts
vda-linux Jul 5, 2025
be327be
libbb/yescrypt: remove unused yescrypt_shared_t
vda-linux Jul 5, 2025
1019692
libbb/yescrypt: remove unreachable support for scrypt hash ("$7$...")
vda-linux Jul 5, 2025
bf8231d
libbb/yescrypt: remove YESCRYPT_INIT_SHARED flag and code using it
vda-linux Jul 5, 2025
3d9b965
libbb/yescrypt: remove unused yescrypt_binary_t
vda-linux Jul 5, 2025
e189464
libbb/yescrypt: make some functions static
vda-linux Jul 6, 2025
9b6e03f
libbb/yescrypt: remove unused yescrypt_region_t tmp
vda-linux Jul 6, 2025
1524540
libbb/yescrypt: remove unused variable
vda-linux Jul 6, 2025
1c97700
libbb/yescrypt: code shrink in parameter decoding
vda-linux Jul 6, 2025
85d3c48
libbb/yescrypt: code shrink in salt decoding
vda-linux Jul 6, 2025
736589f
libbb/yescrypt: reduce the number of function parameters
vda-linux Jul 6, 2025
8be6daf
libbb/yescrypt: use mmap for allocation, it's large - 16Mbytes
vda-linux Jul 6, 2025
ffac25d
libbb/yescrypt: comment tweaks
vda-linux Jul 6, 2025
4e5a6b6
libbb/yescrypt: remove extra sha256 implementation
vda-linux Jul 6, 2025
62abd47
Move "sha256-hash a memory array and produce the digest" helper to libbb
vda-linux Jul 6, 2025
b21cd48
libbb/yescrypt: code shrink
vda-linux Jul 6, 2025
0893bc3
libbb/yescrypt: code shrink
vda-linux Jul 6, 2025
9c4cd75
restore mangled comment
vda-linux Jul 6, 2025
b8f7600
libbb/yescrypt: more efficient byteswapping
vda-linux Jul 6, 2025
f5af8ae
libbb/yescrypt: shrink PBKDF2
vda-linux Jul 6, 2025
23b5527
libbb/yescrypt: use common ACSII char-to-64 conversion code
vda-linux Jul 6, 2025
82bbbd2
libbb: code shrink in DES crypt
vda-linux Jul 6, 2025
447eb6b
libbb: in DES crypt, error out on invalid salt chars
vda-linux Jul 6, 2025
aebe6f7
libbb/yescrypt: remove inlines (whcih gcc detects anyway) and dead if…
vda-linux Jul 6, 2025
0574928
libbb/yescrypt: remove unused prefetching code
vda-linux Jul 6, 2025
f3a1b7b
libbb/yescrypt: remove one NOINLINE, add copyright headers, merge two…
vda-linux Jul 6, 2025
5e17e3c
libbb: shuffle ascii64 code around, shrink i2a64()
vda-linux Jul 6, 2025
53de6e6
libbb/yescrypt: use common ascii64 encoding routine
vda-linux Jul 6, 2025
a2a5db4
libbb/pw_ascii64.c: add forgotten source file
vda-linux Jul 6, 2025
e2091c9
libbb: add two more forgotten source files
vda-linux Jul 7, 2025
1a0913d
libbb: factor out HMAC code from TLS
vda-linux Jul 7, 2025
c117304
libbb/yescrypt: remove redundant SHA256 HMAC implementation
vda-linux Jul 7, 2025
f464be2
libbb/yescrypt: make it possible to set constant parameters, and set …
vda-linux Jul 7, 2025
63025e8
libbb/yescrypt: remove forgotten SHA256 HMAC header file
vda-linux Jul 7, 2025
75758c7
libbb/yescrypt: accept longer salts (up to 84 chars)
vda-linux Jul 7, 2025
479d8db
libbb/yescrypt: fix salts ending in dots (corresponding to binary zeros)
vda-linux Jul 7, 2025
5e9b95f
cryptpw: -m sha512crypt must also be accepted
vda-linux Jul 7, 2025
e348409
libbb/yescrypt: code shrink
vda-linux Jul 7, 2025
67b98c7
libbb/yescrypt: no need to find salt-terminating "$" twice
vda-linux Jul 7, 2025
7798f65
add libbb/yescrypt/PARAMETERS
vda-linux Jul 7, 2025
e5d3a87
libbb/yescrypt: 64-bit build fixes
vda-linux Jul 7, 2025
f8e9bd3
libbb/yescrypt: disable unrolling in two places
vda-linux Jul 7, 2025
8466c3e
libbb/yescrypt: madvise(MADV_HUGEPAGE) our usually very large allocation
vda-linux Jul 7, 2025
d18ac08
libbb/yescrypt: code shrink
vda-linux Jul 7, 2025
78bd8a4
libbb/yescrypt: explain and shrink decode64_uint32()
vda-linux Jul 8, 2025
d0f0874
libbb/yescrypt: disable code which accepts unusual yescrypt parameters
vda-linux Jul 8, 2025
0930708
libbb/yescrypt: disable NROM code
vda-linux Jul 8, 2025
7b313c3
libbb: code shrink in sha_crypt()
vda-linux Jul 8, 2025
e9c21c5
hush: fix SEGV on "echo << >" and such
vda-linux Jul 8, 2025
c305c81
libbb: introduce and use block-XOR functions
vda-linux Jul 9, 2025
11d4c08
libbb/bitops.c: add inlining comment
vda-linux Jul 9, 2025
95f169f
libbb/yescrypt: code shrink
vda-linux Jul 9, 2025
e62bfbc
libbb/yescrypt: code shrink
vda-linux Jul 11, 2025
abe0b45
libbb/yescrypt: code shrink
vda-linux Jul 15, 2025
b823735
libbb/yescrypt: actually, largest allowed salt is 86 chars, support that
vda-linux Jul 17, 2025
dde90f1
libbb.h: increase MAX_PW_SALT_LEN
vda-linux Jul 17, 2025
d2ef2c7
password applets: update help text
vda-linux Jul 18, 2025
504f444
sulogin: set ^C to SIG_DFL before execing the shell
vda-linux Jul 18, 2025
27e1fc6
ntpd: replace two bb_info_msg's with bb_error_msg
vda-linux Jul 18, 2025
ee2ef17
tftp: use bb_error_msg instead of info_msg for a debug message
vda-linux Jul 18, 2025
94591a1
bootchartd: check the result of opendir("/proc")
vda-linux Jul 19, 2025
51b45ce
libbb/yescrypt: code shrink
vda-linux Jul 19, 2025
6979467
cryptpw: fix detection of crypt algo from salt (was broken if default…
vda-linux Jul 19, 2025
c6b9e76
libbb: crypt_make_pw_salt(): fix yescrypt's random salt last char
vda-linux Jul 19, 2025
77a49a6
libbb/yescrypt: de-unroll salsa20()
vda-linux Jul 20, 2025
d23ad55
libbb: change define names in SHA-NI code to match kernel source more…
vda-linux Jul 21, 2025
ed22c5b
libbb: SHA-NI code shrink
vda-linux Jul 21, 2025
e022ff8
libbb: SHA-NI - document that unpckhpd also works, no code changes
vda-linux Jul 22, 2025
628a7b2
telnetd: improve --help
vda-linux Jul 27, 2025
dcbb69e
sha384sum: new applet
Jul 30, 2025
65deb9f
sha3sum: add -aBITS tests
vda-linux Jul 30, 2025
427f808
date: return failure exit code on clock_settime error
3x380V Jun 14, 2023
41f677e
crond: reap orphaned grandchildren to prevent zombie buildup
vaab May 31, 2025
a98b95b
*: use safe_waitpid() or wait_any_nohang() where approppriate
vda-linux Jul 30, 2025
551bfdb
ls: implement -q, fix -w0, reduce startup time
vda-linux Jul 31, 2025
bb18473
ls: lack of -q should not suppress -Q
vda-linux Jul 31, 2025
4f3a56d
ls: fix -Q to match GNU
vda-linux Jul 31, 2025
e95086b
libbb/yescrypt: code shrink
vda-linux Aug 1, 2025
0fea54a
libbb/dump: much faster formatting of %_u on x86
vda-linux Aug 1, 2025
4f43bda
ls: code shrink
vda-linux Aug 1, 2025
2d7ff2c
ls: don't do unnecessary tty operations when called from ftpd
vda-linux Aug 1, 2025
91d8b4e
ftpd: code shrink, move replace_char() to libbb
vda-linux Aug 2, 2025
7d782e8
shell: fix the check of empty HISTFILE
vda-linux Aug 2, 2025
e591316
hush: rename hush_exit to save_history_run_exit_trap_and_exit, sigexi…
vda-linux Aug 2, 2025
cdbb695
hush: don't save history in subshells; on NOMMU, don't be interactive…
vda-linux Aug 2, 2025
c2ef7c6
hush: if !JOBS, skip tests which wouldn't work
vda-linux Aug 3, 2025
26fdc7c
docs: Add links to cmd description from cmd list
Jul 4, 2025
4539262
hush: do not save history on xfunc error, it's unsafe
vda-linux Aug 3, 2025
dba5734
hush: make NORETURN declarations lees verbose, no code changes
vda-linux Aug 3, 2025
778fce3
hush: fix build failure if !CONFIG_HUSH_JOB
vda-linux Aug 3, 2025
58a54fb
hush: disentangle interactiveness/job_control setup code
vda-linux Aug 3, 2025
02b518d
hush: fix memory leak caused by compiler optimizing out a store
vda-linux Aug 3, 2025
d7d8ffe
shell: typo and whitespace fixes, no code changes
vda-linux Aug 3, 2025
a33ce61
libbb: much faster concat_path_file()
vda-linux Aug 4, 2025
5f3a986
libbb: simplify concat_path_file()
vda-linux Aug 4, 2025
c1b5c35
top: do not rescan processes on second 's'
vda-linux Aug 4, 2025
c229982
top: fix display of very large VSZ
vda-linux Aug 5, 2025
d647d8a
top: show RSS instead of VSF, virtual mapped size is often meaningless
vda-linux Aug 5, 2025
1044533
top: make uppercase 'S' walk topmem in opposite direction
vda-linux Aug 5, 2025
3aa2bee
top: reduce flicker: redraw screen with "clear to EOL" commands, not …
vda-linux Aug 5, 2025
58b2353
top: improve response time to keyboard input
vda-linux Aug 5, 2025
d16bde6
top,pmap: do not use common code for reading /proc/PID/smaps
vda-linux Aug 5, 2025
5a8c030
pmap: increase max handled command line length to 4k
vda-linux Aug 5, 2025
2363938
top: consistently NOT use the last column of the display
vda-linux Aug 5, 2025
1bd8d71
top: disentangle printing logic
vda-linux Aug 5, 2025
8bde71e
top: simplify command line reading
vda-linux Aug 5, 2025
40c2d01
libbb: make read_cmdline() replace chars 1..31 with '?', not space
vda-linux Aug 6, 2025
47d27cd
libbb: fix too-narrow variable in procps_read_smaps() causing incorre…
vda-linux Aug 6, 2025
0b05a4e
top,pmap: speed up /smaps parsing
vda-linux Aug 6, 2025
8f5d890
showkey: make -a, -k, -s mutually exclusive
vda-linux Aug 6, 2025
558ef49
hush: optimization: do not glob words "[" and "[["
vda-linux Aug 6, 2025
7648dc7
ash,hush: fix corner cases with backslash-newlines in heredocs
vda-linux Aug 6, 2025
abab146
ash: fix heredoc.tests broken by last commit
vda-linux Aug 7, 2025
34948f1
hush: smarter optimization for not-globbing [ and [[
vda-linux Aug 7, 2025
422f4ed
ash: fix cmdputs - was showing some variable forms incorrectly
vda-linux Aug 7, 2025
5b34055
ash: reuse vstype_suffix[] in debug code, shrink it
vda-linux Aug 8, 2025
fa82ef1
shells: add testsuite item
vda-linux Aug 8, 2025
98b1a00
ash: jobs: drop unused node parameter in makejob()
vda-linux Aug 9, 2025
6d44762
ash: options: Do not set commandname in procargs
vda-linux Aug 9, 2025
4eb4141
ash: eval: Always set exitstatus in evaltree
vda-linux Aug 9, 2025
c927551
shells: fix a typo in var_backslash1.tests, expand it while at it
vda-linux Aug 9, 2025
53b3854
ash: fix fallout of no-more-set commandname
vda-linux Aug 9, 2025
9f49078
ash: rename got_sigchld, doing_jobctl, and INT_ON/OFF to match dash
vda-linux Aug 9, 2025
df15402
ash: eval: Add vfork support
vda-linux Aug 9, 2025
4ce8afe
ahs: jobs: Block signals during tcsetpgrp
vda-linux Aug 9, 2025
81274d8
ash: eval: Reset handler when entering a subshell
vda-linux Aug 9, 2025
9b67dde
ash: redir: Retry open on EINTR
vda-linux Aug 9, 2025
f6fb3c6
ash: move 100 bytes off global .data / .bss, no logic changes
vda-linux Aug 10, 2025
ea2022e
ash: converge waiting code to dash in its form, add comments, no code…
vda-linux Aug 10, 2025
e660eab
*: code shrink using sigprocmask2() where appropriate
vda-linux Aug 10, 2025
d18c9ea
shells: testcase: add another test for EINTR on fifo open
vda-linux Aug 11, 2025
0da6c81
hush: fix var_backslash1.tests
vda-linux Aug 11, 2025
1cd53c1
ash: parser: Invalid redirections are run-time, not syntax errors
vda-linux Aug 11, 2025
ab1de7d
hush: test for, and disallow several invalid syntaxes
vda-linux Aug 11, 2025
5ecbed0
hush: do not segfault on "for </dev/null v in..."
vda-linux Aug 12, 2025
2b0b74e
hush: drop ctx_inverted, use pipe->pi_inverted
vda-linux Aug 12, 2025
f161bc6
hush: allow nested negation "! ! ! CMD" - bash 5.2.15 allows it
vda-linux Aug 12, 2025
1847fee
hush: fix a corner case in "case" stmt, ctx_dsemicolon is in fact unused
vda-linux Aug 12, 2025
a5cf673
hush: create a macro IS_NULL_WORD to test for null shell word
vda-linux Aug 13, 2025
187f24b
hush: ~5% faster parsing of typical shell scripts
vda-linux Aug 13, 2025
f29ab91
hush: shrink i_getch, rename two functions
vda-linux Aug 13, 2025
438b92e
hush: optimize decoding of $'str' - avoid extra function call if we can
vda-linux Aug 13, 2025
2bb8b9b
hush: remove two strchr's from the hottest parsing loop
vda-linux Aug 14, 2025
d029e80
hush: remove the is_blank dance
vda-linux Aug 14, 2025
2793714
hush: move tickquote1.tests to hush-bugs/ - it's a known bug
vda-linux Aug 14, 2025
4343ca9
hush: improve code readability, no logic changes
vda-linux Aug 14, 2025
cad5a79
hush: explain "empty quoted str marker" trick
vda-linux Aug 14, 2025
6cc3380
hush: undo incorrect change which allows a'b'=c to be assignment
vda-linux Aug 14, 2025
a8f2042
hush: shrink syntax error handling
vda-linux Aug 14, 2025
0d1f6a5
hush: allow faster parsing for "./:@" characters
vda-linux Aug 14, 2025
3e766dc
hush: implement <<<here_string syntax
vda-linux Aug 14, 2025
5806d2a
hush: optimization in set_local_var()
vda-linux Aug 15, 2025
5ba6ad7
hush: optional alias support
vda-linux Aug 17, 2025
7423bbb
hush: fix nested alias expansion
vda-linux Aug 17, 2025
94cb769
hush: make "alias" print aliases in properly escaped form
vda-linux Aug 17, 2025
1a94765
hush: comment fixes
vda-linux Aug 17, 2025
36f1b16
hush: fix infinite loop expanding alias a="nice&&a"
vda-linux Aug 17, 2025
a30882d
hush: remove always-true conditional
vda-linux Aug 17, 2025
9646695
hush: recognize "function FUNC { cmd; }" syntax
vda-linux Aug 17, 2025
84d4ac3
hush: with --login, errors /etc/profile in must not exit shell
vda-linux Aug 17, 2025
2ccb891
hush: make "function" keyword support optional
vda-linux Aug 17, 2025
2bdec03
hush: disentangle keyword detection, no logic changes
vda-linux Aug 18, 2025
5c2c291
hush: do not SEGV on if { echo foo; } then { echo bar; } fi
vda-linux Aug 18, 2025
5d66c8a
hush: shrink "function" code
vda-linux Aug 18, 2025
b4cedd4
hush: fix several syntax corner cases with function definitions
vda-linux Aug 18, 2025
1065469
ash: implement <<<here_string syntax
vda-linux Sep 2, 2025
3681b5f
hush: changes to comments and whitespace, no code changes
vda-linux Sep 3, 2025
381a40a
ash: change procargs() to match recent dash change
vda-linux Sep 23, 2025
f5e1bf9
archival/libarchive: sanitize filenames on output (prevent control se…
vda-linux Sep 24, 2025
9443b0b
vi: warn about range in ':!' command
vda-linux Sep 24, 2025
552003d
selinux: fix potential segfault in sestatus
vda-linux Oct 7, 2025
3cc2460
chrt: support passing `-p 0` to operate on self
vda-linux Oct 7, 2025
a0017a5
cp: fix `cp -aT` overwriting symlink to directories
vda-linux Oct 7, 2025
3621595
nsenter,unshare: don't use xvfork_parent_waits_and_exits(), it SEGVs …
vda-linux Oct 8, 2025
3ff3cb4
ntpd: set tmx.maxerror properly - avoid STA_UNSYNC
vda-linux Oct 11, 2025
b99a529
busybox: optional --version support
vda-linux Oct 13, 2025
782e3fc
last: fix ignoring the first login entry
vda-linux Oct 23, 2025
8cafd7a
lineedit: fix PS1='\W' for root directory
vda-linux Oct 23, 2025
d549c8b
ls: restore functionality of --color
vda-linux Oct 23, 2025
4ee218a
pgrep/pkill: fix -x to also match comm field
vda-linux Oct 23, 2025
b8cf048
dd: fix overflow for very large count/seek/skip values
vda-linux Nov 2, 2025
8d7ae80
eject: fix missing -s option in trivial usage
vda-linux Nov 2, 2025
b143b3f
tls: better error message when TLS record is truncated
vda-linux Nov 25, 2025
d755846
xxd: fix -pANYTHING handling (-pc50 does not mean -p -c50)
vda-linux Nov 30, 2025
ae3cb10
cmp: fix -n flag incorrectly enabling verbose output
Giorgio1997 Dec 6, 2025
e78e8bc
cmp: add EOF check in skip loop
Giorgio1997 Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ config FEATURE_INSTALLER
busybox at runtime to create hard links or symlinks for all the
applets that are compiled into busybox.

config FEATURE_VERSION
bool "Support --version"
default y
depends on BUSYBOX
help
Enable 'busybox --version' support.

config INSTALL_NO_USR
bool "Don't use /usr"
default n
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION = 1
PATCHLEVEL = 37
PATCHLEVEL = 38
SUBLEVEL = 0
EXTRAVERSION = .git
NAME = Unnamed
Expand Down Expand Up @@ -476,6 +476,7 @@ libs-y := \
findutils/ \
init/ \
libbb/ \
libbb/yescrypt/ \
libpwdgrp/ \
loginutils/ \
mailutils/ \
Expand Down Expand Up @@ -612,8 +613,12 @@ quiet_cmd_busybox__ ?= LINK $@
"$(core-y)" \
"$(libs-y)" \
"$(LDLIBS)" \
"$(CONFIG_EXTRA_LDLIBS)" \
$(CONFIG_EXTRA_LDLIBS) \
&& $(srctree)/scripts/generate_BUFSIZ.sh --post include/common_bufsiz.h
# ^^^ note: CONFIG_xyz strings already have double quotes: their value
# is '"LIB LIB2"', therefore $(CONFIG_EXTRA_LDLIBS) above must NOT be written
# as "$(CONFIG_EXTRA_LDLIBS)", it would be passed as ""LIB LIB2"",
# and LIB2 would end up in $9, not $8 (and lost or misinterpreted).

# Generate System.map
quiet_cmd_sysmap = SYSMAP
Expand Down
4 changes: 2 additions & 2 deletions Makefile.custom
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
docs/BusyBox.txt: docs/busybox.pod
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-pod2text $< > $@
$(Q)-pod2text --quotes=none $< > $@

docs/busybox.1: docs/busybox.pod
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-pod2man --center=busybox --release="version $(KERNELVERSION)" $< > $@
$(Q)-pod2man --quotes=none --center=busybox --release="version $(KERNELVERSION)" $< > $@

docs/BusyBox.html: docs/busybox.net/BusyBox.html
$(disp_doc)
Expand Down
1 change: 1 addition & 0 deletions NOFORK_NOEXEC.lst
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ setuidgid - noexec. spawner
sha1sum - noexec. runner
sha256sum - noexec. runner
sha3sum - noexec. runner
sha384sum - noexec. runner
sha512sum - noexec. runner
showkey - interactive, longterm
shred - runner
Expand Down
17 changes: 12 additions & 5 deletions applets/usage_pod.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,30 +67,37 @@ int main(void)
}
if (col == 0) {
col = 6;
printf("\t");
} else {
printf(", ");
}
printf("%s", usage_array[i].aname);
if (usage_array[i].usage[0] != NOUSAGE_STR[0]) {
/*
* If the applet usage string will be included in the final document
* optimistically link to its header (which is just the applet name).
*/
printf("L<C<%1$s>|/\"%1$s\">", usage_array[i].aname);
} else {
/* Without a usage string, just output the applet name with no link. */
printf("C<%s>", usage_array[i].aname);
}
col += len2;
}
printf("\n\n");

printf("=head1 COMMAND DESCRIPTIONS\n\n");
printf("=over 4\n\n");

for (i = 0; i < num_messages; i++) {
if (usage_array[i].aname[0] >= 'a' && usage_array[i].aname[0] <= 'z'
&& usage_array[i].usage[0] != NOUSAGE_STR[0]
) {
printf("=item B<%s>\n\n", usage_array[i].aname);
/* This is the heading that will be linked from the command list. */
printf("=head2 %s\n\n", usage_array[i].aname);
if (usage_array[i].usage[0])
printf("%s %s\n\n", usage_array[i].aname, usage_array[i].usage);
else
printf("%s\n\n", usage_array[i].aname);
}
}
printf("=back\n\n");

return 0;
}
Expand Down
11 changes: 11 additions & 0 deletions archival/Config.src
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ config FEATURE_LZMA_FAST
This option reduces decompression time by about 25% at the cost of
a 1K bigger binary.

config FEATURE_PATH_TRAVERSAL_PROTECTION
bool "Prevent extraction of filenames with /../ path component"
default n
help
busybox tar and unzip remove "PREFIX/../" (if it exists)
from extracted names.
This option enables this behavior for all other unpacking applets,
such as cpio, ar, rpm.
GNU cpio 2.15 has NO such sanity check.
# try other archivers and document their behavior?

endmenu
6 changes: 3 additions & 3 deletions archival/bbunzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ int FAST_FUNC bbunpack(char **argv,
goto err;
} else {
/* "clever zcat" with FILE */
/* fail_if_not_compressed because zcat refuses uncompressed input */
int fd = open_zipped(filename, /*fail_if_not_compressed:*/ 1);
/* die_if_not_compressed because zcat refuses uncompressed input */
int fd = open_zipped(filename, /*die_if_not_compressed:*/ 1);
if (fd < 0)
goto err_name;
xmove_fd(fd, STDIN_FILENO);
}
} else
if (option_mask32 & BBUNPK_SEAMLESS_MAGIC) {
/* "clever zcat" on stdin */
if (setup_unzip_on_fd(STDIN_FILENO, /*fail_if_not_compressed*/ 1))
if (setup_unzip_on_fd(STDIN_FILENO, /*die_if_not_compressed*/ 1))
goto err;
}

Expand Down
7 changes: 7 additions & 0 deletions archival/cpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ static NOINLINE int cpio_o(void)
st.st_dev = st.st_rdev = 0;
#endif

if (sizeof(st.st_size) > 4
&& st.st_size > (off_t)0xffffffff
) {
bb_error_msg_and_die("error: file '%s' is larger than 4GB", name);
}

bytes += printf("070701"
"%08X%08X%08X%08X%08X%08X%08X"
"%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */
Expand Down Expand Up @@ -421,6 +427,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
#endif
#endif
"owner\0" Required_argument "R"
"file\0" Required_argument "F"
"verbose\0" No_argument "v"
"null\0" No_argument "0"
"quiet\0" No_argument "\xff"
Expand Down
8 changes: 8 additions & 0 deletions archival/libarchive/data_extract_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
} while (--n != 0);
}
#endif
#if ENABLE_FEATURE_PATH_TRAVERSAL_PROTECTION
/* Strip leading "/" and up to last "/../" path component */
dst_name = (char *)strip_unsafe_prefix(dst_name);
#endif
// ^^^ This may be a problem if some applets do need to extract absolute names.
// (Probably will need to invent ARCHIVE_ALLOW_UNSAFE_NAME flag).
// You might think that rpm needs it, but in my tests rpm's internal cpio
// archive has names like "./usr/bin/FOO", not "/usr/bin/FOO".

if (archive_handle->ah_flags & ARCHIVE_CREATE_LEADING_DIRS) {
char *slash = strrchr(dst_name, '/');
Expand Down
2 changes: 1 addition & 1 deletion archival/libarchive/header_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
void FAST_FUNC header_list(const file_header_t *file_header)
{
//TODO: cpio -vp DIR should output "DIR/NAME", not just "NAME" */
puts(file_header->name);
puts(printable_string(file_header->name));
}
4 changes: 2 additions & 2 deletions archival/libarchive/header_verbose_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header)
ptm->tm_hour,
ptm->tm_min,
ptm->tm_sec,
file_header->name);
printable_string(file_header->name));

#endif /* FEATURE_TAR_UNAME_GNAME */

/* NB: GNU tar shows "->" for symlinks and "link to" for hardlinks */
if (file_header->link_target) {
printf(" -> %s", file_header->link_target);
printf(" -> %s", printable_string(file_header->link_target));
}
bb_putchar('\n');
}
26 changes: 14 additions & 12 deletions archival/libarchive/open_transformer.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog)
/* Used by e.g. rpm which gives us a fd without filename,
* thus we can't guess the format from filename's extension.
*/
static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_compressed)
static transformer_state_t *setup_transformer_on_fd(int fd, int die_if_not_compressed)
{
transformer_state_t *xstate;

Expand Down Expand Up @@ -204,7 +204,7 @@ static transformer_state_t *setup_transformer_on_fd(int fd, int fail_if_not_comp
}

/* No known magic seen */
if (fail_if_not_compressed)
if (die_if_not_compressed)
bb_simple_error_msg_and_die("no gzip"
IF_FEATURE_SEAMLESS_BZ2("/bzip2")
IF_FEATURE_SEAMLESS_XZ("/xz")
Expand Down Expand Up @@ -240,13 +240,15 @@ static void fork_transformer_and_free(transformer_state_t *xstate)
/* Used by e.g. rpm which gives us a fd without filename,
* thus we can't guess the format from filename's extension.
*/
int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_compressed)
int FAST_FUNC setup_unzip_on_fd(int fd, int die_if_not_compressed)
{
transformer_state_t *xstate = setup_transformer_on_fd(fd, fail_if_not_compressed);
transformer_state_t *xstate = setup_transformer_on_fd(fd, die_if_not_compressed);

if (!xstate->xformer) {
/* Not compressed */
int retval = xstate->signature_skipped; /* never zero */
free(xstate);
return 1;
return retval;
}

fork_transformer_and_free(xstate);
Expand All @@ -264,7 +266,7 @@ void FAST_FUNC setup_lzma_on_fd(int fd)
}
#endif

static transformer_state_t *open_transformer(const char *fname, int fail_if_not_compressed)
static transformer_state_t *open_transformer(const char *fname, int die_if_not_compressed)
{
transformer_state_t *xstate;
int fd;
Expand All @@ -284,18 +286,18 @@ static transformer_state_t *open_transformer(const char *fname, int fail_if_not_
}
}

xstate = setup_transformer_on_fd(fd, fail_if_not_compressed);
xstate = setup_transformer_on_fd(fd, die_if_not_compressed);

return xstate;
}

int FAST_FUNC open_zipped(const char *fname, int fail_if_not_compressed)
int FAST_FUNC open_zipped(const char *fname, int die_if_not_compressed)
{
int fd;
transformer_state_t *xstate;

xstate = open_transformer(fname, fail_if_not_compressed);
if (!xstate)
xstate = open_transformer(fname, die_if_not_compressed);
if (!xstate) /* open error */
return -1;

fd = xstate->src_fd;
Expand Down Expand Up @@ -326,7 +328,7 @@ void* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_
transformer_state_t *xstate;
char *image;

xstate = open_transformer(fname, /*fail_if_not_compressed:*/ 0);
xstate = open_transformer(fname, /*die_if_not_compressed:*/ 0);
if (!xstate) /* file open error */
return NULL;

Expand Down Expand Up @@ -371,7 +373,7 @@ void* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_
int fd;
char *image;

fd = open_zipped(fname, /*fail_if_not_compressed:*/ 0);
fd = open_zipped(fname, /*die_if_not_compressed:*/ 0);
if (fd < 0)
return NULL;

Expand Down
6 changes: 5 additions & 1 deletion archival/libarchive/unsafe_prefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const char* FAST_FUNC strip_unsafe_prefix(const char *str)
cp++;
continue;
}
if (is_prefixed_with(cp, "/../"+1)) {
/* We are called lots of times.
* is_prefixed_with(cp, "../") is slower than open-coding it,
* with minimal code growth (~few bytes).
*/
if (cp[0] == '.' && cp[1] == '.' && cp[2] == '/') {
cp += 3;
continue;
}
Expand Down
9 changes: 7 additions & 2 deletions archival/rpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static void extract_cpio(int fd, const char *source_rpm)
archive_handle->src_fd = fd;
/*archive_handle->offset = 0; - init_handle() did it */

setup_unzip_on_fd(archive_handle->src_fd, /*fail_if_not_compressed:*/ 1);
setup_unzip_on_fd(archive_handle->src_fd, /*die_if_not_compressed:*/ 1);
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
continue;
}
Expand Down Expand Up @@ -533,6 +533,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
// /* We need to know whether child (gzip/bzip/etc) exits abnormally */
// signal(SIGCHLD, check_errors_in_children);

str = NULL;
if (ENABLE_FEATURE_SEAMLESS_LZMA
&& (str = rpm_getstr0(TAG_PAYLOADCOMPRESSOR)) != NULL
&& strcmp(str, "lzma") == 0
Expand All @@ -541,7 +542,11 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
// set up decompressor without detection
setup_lzma_on_fd(rpm_fd);
} else {
setup_unzip_on_fd(rpm_fd, /*fail_if_not_compressed:*/ 1);
int signature_bytes = setup_unzip_on_fd(rpm_fd, /*die_if_not_compressed:*/ 0);
if (signature_bytes != 0) {
xlseek(rpm_fd, - signature_bytes, SEEK_CUR);
bb_error_msg("warning, unknown compression '%s'", str);
}
}

if (bb_copyfd_eof(rpm_fd, STDOUT_FILENO) < 0)
Expand Down
2 changes: 1 addition & 1 deletion archival/tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
* on e.g. tarball with 1st file named "BZh5".
*/
) {
tar_handle->src_fd = open_zipped(tar_filename, /*fail_if_not_compressed:*/ 0);
tar_handle->src_fd = open_zipped(tar_filename, /*die_if_not_compressed:*/ 0);
if (tar_handle->src_fd < 0)
bb_perror_msg_and_die("can't open '%s'", tar_filename);
} else {
Expand Down
4 changes: 2 additions & 2 deletions console-tools/showkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ int showkey_main(int argc UNUSED_PARAM, char **argv)

INIT_G();

// FIXME: aks are all mutually exclusive
getopt32(argv, "aks");
// a,k,s are all mutually exclusive
getopt32(argv, "^" "aks" "\0" "a--ks:k--as:s--ak");

// prepare for raw mode
xget1(&tio, &tio0);
Expand Down
3 changes: 2 additions & 1 deletion coreutils/cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ int cp_main(int argc, char **argv)
(flags & FILEUTILS_DEREFERENCE) ? stat : lstat);
if (s_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;
d_flags = cp_mv_stat(last, &dest_stat);
d_flags = cp_mv_stat2(last, &dest_stat,
(flags & FILEUTILS_NO_TARGET_DIR) ? lstat : stat);
if (d_flags < 0) /* error other than ENOENT */
return EXIT_FAILURE;

Expand Down
Loading