aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeHEADmergemasterRon Yorston12 days10-27/+46
|\
| * eject: fix missing -s option in trivial usagebusyboxDenys Vlasenko2025-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes missing [-s] option in trivial usage section of `eject --help` function old new delta packed_usage 35125 35127 +2 Signed-off-by: Nir Lichtman <nir@lichtman.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: fix overflow for very large count/seek/skip valuesDenys Vlasenko2025-11-082-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>
| * pgrep/pkill: fix -x to also match comm fieldDenys Vlasenko2025-11-081-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>
| * ls: restore functionality of --colorDenys Vlasenko2025-11-081-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>
| * lineedit: fix PS1='\W' for root directoryDenys Vlasenko2025-11-081-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>
| * last: fix ignoring the first login entryDenys Vlasenko2025-11-081-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>
| * busybox: optional --version supportDenys Vlasenko2025-10-132-4/+19
| | | | | | | | | | | | | | function old new delta busybox_main 695 734 +39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: set tmx.maxerror properly - avoid STA_UNSYNCDenys Vlasenko2025-10-111-5/+12
| | | | | | | | | | | | | | function old new delta update_local_clock 872 951 +79 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | paste: fix output when file lengths differRon Yorston12 days3-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | If the files being pasted had different numbers of lines the output was incorrect. Rewrite the loop over all lines to allow for this. Add tests for such conditions. Adds 64-80 bytes. (GitHub issue #542)
* | win32: allow use of /dev/ttyRon Yorston13 days2-10/+15
| | | | | | | | | | | | | | | | | | Treat /dev/tty as an alias for Windows' 'con' device. The code is similar to that used for /dev/null. Adds 24-48 bytes. (GitHub issue #538)
* | compress PNG icons moreViktor Szakats2025-11-072-0/+0
| | | | | | | | | | aterm.png: 2477 -> 2303 (-174 bytes) sterm.png: 1022 -> 774 (-248 bytes)
* | win32: allow the use of PNG format iconsRon Yorston2025-11-069-11/+42
| | | | | | | | | | | | | | | | | | | | | | Convert the icons to PNG format (by simply exporting them from GIMP and selecting the 'Compressed (PNG)' chackbox). Allow these to be selected instead of ICO format at build time. Use the PNG icons by default in the Unicode and aarch64 builds. Saves 26KB in those cases. (GitHub PR #540)
* | manifest: integrate into resources.rc, reduce binary sizeViktor Szakats2025-11-064-58/+50
| | | | | | | | | | | | | | | | | | | | It also makes the version number within the manifest use the version macros, replacing the hard-coded "6.0.0.0". Unicode: 32668 -> 32188 (-480 bytes) non-Unicode: 32412 -> 31956 (-456 bytes) with icons included.
* | Further tweaks to make_single_applets.shRon Yorston2025-10-293-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the applet configurations of 'reset' and 'which' in the Microsoft Windows port resulted in these applets being enabled in every single-applet executable built by make_single_applets.sh. Alter the configuration to avoid this. Remove PLATFORM_POSIX and PLATFORM_MINGW32 from the list of applets to be built. (GitHub issue #536)
* | Allow make_single_applets.sh to work for WindowsRon Yorston2025-10-271-2/+11
| | | | | | | | | | | | | | Tweak the make_single_applets.sh script so it works for Windows builds. (GitHub issue #536)
* | stty: drop 'rows' and 'columns' settingsFRP-5857-g3681e397fRon Yorston2025-10-102-5/+10
| | | | | | | | | | | | | | | | | | Setting the console dimensions doesn't work reliably. Drop support for the 'rows' and 'columns' settings. Saves 752-768 bytes. (GitHub issue #58)
* | Merge branch 'busybox' into mergeRon Yorston2025-10-097-10/+39
|\|
| * nsenter,unshare: don't use xvfork_parent_waits_and_exits(), it SEGVs on ppc64leDenys Vlasenko2025-10-083-2/+25
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cp: fix `cp -aT` overwriting symlink to directoriesDenys Vlasenko2025-10-071-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>
| * chrt: support passing `-p 0` to operate on selfDenys Vlasenko2025-10-071-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>
| * selinux: fix potential segfault in sestatusDenys Vlasenko2025-10-071-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>
| * vi: warn about range in ':!' commandDenys Vlasenko2025-10-071-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>
* | flock: enable by defaultRon Yorston2025-10-097-4/+148
| | | | | | | | | | | | | | | | | | Use the Gnulib implementation of flock(2) to allow the flock applet to be enabled. Costs 900-984 bytes. (GitHub issue #528)
* | win32: use RtlGenRandom for /dev/urandomRon Yorston2025-10-0913-306/+45
| | | | | | | | | | | | | | | | | | Use the (somewhat ancient) Microsoft RtlGenRandom() function to provide random data for /dev/urandom. Saves 176-240 bytes. (GitHub issue #519)
* | ash: output '^C' direct to consoleRon Yorston2025-10-081-1/+1
| | | | | | | | | | | | | | | | | | The '^C' displayed on interrupt should go directly to the console to emulate the typical behaviour of the Unix tty driver. Adds 16 bytes. (GitHub issue #531)
* | build system: adjust defaults for aarch64 buildRon Yorston2025-10-081-11/+11
| | | | | | | | | | | | | | | | The default configuration for Windows on ARM now: - omits unwind tables; - supports Unicode.
* | build system: omit stack unwind tables in 32-bit buildsRon Yorston2025-10-061-1/+1
| |
* | ash: output '^C' when wait builtin is interruptedRon Yorston2025-10-061-3/+13
| | | | | | | | | | | | | | When the wait builtin detects an interrupt it should print '^C' to stdout, as is done in other similar cases. Saves 16 bytes in the 64-bit build.
* | Merge branch 'busybox' into mergeRon Yorston2025-10-063-10/+6
|\|
| * archival/libarchive: sanitize filenames on output (prevent control sequence ↵Denys Vlasenko2025-09-242-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>
| * ash: change procargs() to match recent dash changeDenys Vlasenko2025-09-231-7/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: allow ctrl-c to interrupt wait in presence of trapRon Yorston2025-10-051-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 387d01161 (ash: allow wait builtin to be interrupted) allowed the wait builtin to be interrupted by ctrl-c. However, this didn't work in the presence of a trap. When waitpid_child() detects an interrupt propagate this up the call stack so the wait builtin terminates and the trap is invoked. Adds 80-88 bytes. (GitHub issue #530)
* | ash: make ctrl-c trap handling closer to upstreamRon Yorston2025-10-051-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64c8f5f3d0 (ash: add support for INT trap) didn't follow upstream behaviour. If a trap is supplied for SIGINT, upstream's signal handler detects this and doesn't call raise_interrupt(). The busybox-w32 implementation called raise_interrupt() but had it do nothing. Modify the code to match upstream's behaviour. Saves 16-36 bytes.
* | ash: allow wait builtin to be interruptedRon Yorston2025-10-031-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | After commit f6be217fa (ash: wait builtin should block) it wasn't possible to interrupt a call to wait with Ctrl-C. A blocking wait should be stopped from time to time to check for an interrupt. Adds 32 bytes. (GitHub issue #529)
* | ash: wait builtin should blockRon Yorston2025-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was found that the 'wait' shell builtin would use 100% of a core when waiting for a process to terminate: sleep 60 & wait This is a regression caused by commit bb8f6b688 (ash: fix slow running when background job is present). See the commit message and GitHub issue #434 for the long and involved history. The problem is in the Windows implementation of waitproc() in ash. The 'block' argument to waitproc() can take three values: DOWAIT_NONBLOCK DOWAIT_BLOCK DOWAIT_CHILD_OR_SIG The first two have obvious meanings. The third performs a non- blocking wait(2) and if no PID is returned it waits for SIGCHLD. So in effect it's a blocking wait. The Windows implementation would perform a non-blocking wait(2) but couldn't then wait for SIGCHLD, because Windows doesn't have such a signal. As a result the 'wait' builtin would loop calling waitproc(). To avoid this DOWAIT_CHILD_OR_SIG should be treated as a blocking wait in waitproc(). (GitHub issue #529)
* | Further mingw-w64/gcc build tweaksRon Yorston2025-10-022-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6481bb22b (win32: use 64-bit time on 32-bit platforms) fails to build with mingw32-gcc prior to mingw-w64 10.0.0. Don't used 64-bit time for such builds. mingw-w64 7.0.0 and below don't have some definitions required for native TLS support. This is enabled by default in the 64-bit Unicode build. Add the definitions required for the default build. TLS 1.3 support needs more but isn't enabled by default. (GitHub issue #527)
* | Allow building with older mingw-w64/gccRon Yorston2025-10-013-2/+7
| | | | | | | | | | | | | | | | | | Recent versions of busybox-w32 rely on features which are only available in contemporary versions of mingw-w64 and gcc. Allow building on somewhat older toolchains. (GitHub issue #527)
* | win32: use correct errno for fopen() of directoryRon Yorston2025-09-191-1/+6
| | | | | | | | | | | | | | | | | | | | We already fixed up errno when a directory was opened by open(). Do the same for fopen(). This allows grep to give a more useful error message when it's asked to open a directory. Adds 64 bytes. (GitHub issue #521)
* | vi: warn about range in ':!' commandRon Yorston2025-09-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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. Adds 32 bytes. (GitHub issue #524)
* | ls: restore functionality of --colorRon Yorston2025-09-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | Since upstream commit 551bfdb97 (ls: implement -q, fix -w0, reduce startup time) was merged the '--color' option behaves as though the default argument 'always' had been specified. This is due to an explict short option for '--color' being given, but without specifying that an argument is expected. (GitHub issue #522)
* | Merge branch 'busybox' into mergeRon Yorston2025-09-114-35/+139
|\|
| * hush: changes to comments and whitespace, no code changesDenys Vlasenko2025-09-031-8/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: implement <<<here_string syntaxDenys Vlasenko2025-09-023-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>
* | Merge branch 'busybox' into mergeRon Yorston2025-09-1157-738/+1545
|\|
| * hush: fix several syntax corner cases with function definitionsDenys Vlasenko2025-08-189-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>
| * hush: shrink "function" codeDenys Vlasenko2025-08-181-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>
| * hush: do not SEGV on if { echo foo; } then { echo bar; } fiDenys Vlasenko2025-08-181-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>
| * hush: disentangle keyword detection, no logic changesDenys Vlasenko2025-08-181-25/+27
| | | | | | | | | | | | | | function old new delta done_word 790 766 -24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: make "function" keyword support optionalDenys Vlasenko2025-08-171-11/+22
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>