aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * shell: improve bash compatibility of read built-inRon Yorston2025-07-0111-33/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the read built-in more compatible with bash: - Return an exit code of 142 on timeout. - When the timeout expires before a newline is detected in the input bash captures the partial input. This behaviour is new since bash version 4.4. BusyBox shells had the pre-4.4 behaviour where the input was lost. Update the tests to suit and fix a couple of compiler errors in the testsuite. function old new delta builtin_read 154 174 +20 readcmd 213 228 +15 shell_builtin_read 1364 1370 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 41/0) Total: 41 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * df: -k overrides block size to 1k even if $POSIXLY_CORRECTDenys Vlasenko2025-07-011-2/+5
| | | | | | | | | | | | | | function old new delta df_main 1060 1070 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexdump: add tests for %x, handle little/big endian properlyRadoslav Kolev2025-07-011-22/+69
| | | | | | | | | | Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: make -B test little endian only, add variant for big endianRadoslav Kolev2025-07-011-1/+12
| | | | | | | | | | Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexdump: fix regression for uint16 on big endian systemsRadoslav Kolev2025-07-011-2/+8
| | | | | | | | | | | | | | | | | | Commit 34751d8bf introduced a bug in the handling of uint16 values on big endian systems not considered safe for unaligned access when falling back to memcpy. Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: Raise MAXDIST to 3s for better tolerance and consistency with chronyMichael Glembotzki2025-07-011-1/+1
| | | | | | | | | | | | | | | | function old new delta select_and_cluster 1088 1093 +5 Signed-off-by: Michael Glembotzki <m.glembo@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip route: make cache printing a bit more similar to upstreamDenys Vlasenko2025-07-011-9/+7
| | | | | | | | | | | | | | function old new delta print_route 1573 1565 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix left-over print to stdoutAhmad Fatoum2025-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There's code printing to stderr both before and after the single call to puts inside put_cur_glyph_and_inc_cursor(). This is likely an oversight as we want everything to go through the same file descriptor, so switch it over to fputs. Fixes: fd47f056765a ("lineedit: print prompt and editing operations to stderr") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix printing lines during tab completionAhmad Fatoum2025-07-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Indentation and escape characters are all output to stderr now, but the matches themself remained on stdout leading to garbled output on Tab completion. Print the results to stderr as well to fix this. Fixes: fd47f056765a ("lineedit: print prompt and editing operations to stderr") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | tls: change build defaultsRon Yorston2025-08-084-4/+16
| | | | | | | | | | Update the default build configurations to enable the native TLS library in the 64-bit Unicode and ARM64 builds.
* | tls: whitespace fixesRon Yorston2025-08-085-8/+8
| | | | | | | | No functional changes.
* | tls: fix schannel handshake on older WindowsRFL8902025-08-081-1/+1
| |
* | stty: fix build for Windows XPRon Yorston2025-08-071-0/+10
| | | | | | | | | | | | | | | | The ioctl() to get the size of the terminal windows used functions which weren't available on Windows XP. Load these dynamically to avoid failure. Adds 160 bytes.
* | tls: add Schannel implementationrfl8902025-08-076-14/+635
| | | | | | | | | | | | | | Not enabled by default. When enabled without TLS 1.3 support, saves 16784-18776 bytes. (GitHub PR #510)
* | sed: ensure temporary file is deleted on errorRon Yorston2025-07-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | It wasn't possible to delete the temporary output file in case of error on Windows because it was open. Close the file before trying to unlink it. Adds 16 bytes. (GitHub issue #509)
* | Call BCryptDestroyHash before freeing memory handleRFL8902025-07-302-0/+2
| |
* | stty: enable a minimal Windows implementationRon Yorston2025-07-2511-31/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a minimal stty applet for Windows. - Display and set terminal rows and columns - Enable/disable raw/cooked mode - Enable/disable echo mode - Implement 'stty sane' to reset raw/cooked/echo Adds 2120-2304 bytes. (GitHub issue #58)
* | testsuite: check that wget handles httpsRon Yorston2025-07-111-0/+4
| | | | | | | | | | | | We failed to notice a problem with the native Windows crypto support for TLS because there was no test. Add a test case, using wget to fetch an https URL.
* | win32: deduplicate die_if_error()Ron Yorston2025-07-114-28/+20
| | | | | | | | | | | | | | There were two copies of the static function die_if_error(). Replace these with a single external function. Saves 16 bytes.
* | remove comments from old implementationRFL8902025-07-111-4/+0
| |
* | patch tls.c to work with CNG implementationRFL8902025-07-112-4/+90
| |
* | Revert "win32: disable use of Windows crypto library"RFL8902025-07-111-1/+1
| | | | | | | | This reverts commit 7e164c132659f536e7ceae1d22cd1428e91adc51.
* | shell: avoid miscounting backslashes in read built-inRon Yorston2025-07-071-2/+5
| | | | | | | | | | | | | | | | | | | | When the '-n' option was used to limit the number of characters read, any backslashes in the input weren't correctly accounted for. Adds 16 bytes. (GitHub issue #504)
* | df: enable -a and -B optionsRon Yorston2025-07-025-10/+24
| | | | | | | | | | | | | | | | | | | | | | The -a, -i and -B options are controlled by FEATURE_DF_FANCY in the build-time configuration. Enable this by default in the Windows builds, but with -i disabled as it provides no useful information. Adds 144-168 bytes. (GitHub issue #503)
* | ash: don't mistake errors for timeouts in read built-inRon Yorston2025-07-011-6/+9
| | | | | | | | | | | | | | | | | | | | | | Commit e07a73a15 (ash: bring 'read' built-in closer to bash) added code to treat a timeout differently from an error returned by poll(2). This falsely assumed that only an EINTR error was relevant. We must allow for other errors. Adds 16 bytes. (GitHub issue #502)
* | ash: kill background processes on SIGINTRon Yorston2025-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this script: #!/bin/sh -e f() { for n in $(seq 1 10); do echo "Background $n ..." sleep 1 done } f 1 & f 2 & f 3 & wait If this was interrupted by Ctrl+C the background jobs continued to run. Avoid this by sending SIGINT to all children of the shell. Saves 16 bytes. (See GitHub PR #500)
* | win32: disable use of Windows crypto libraryRon Yorston2025-06-291-1/+1
| | | | | | | | | | | | | | | | SSL was broken by the recent introduction of the Windows crypto library. Disable its use until this can be fixed. Only the 64-bit Unicode build is affected. (GitHub PR #498)
* | ash: bring 'read' built-in closer to bashRon Yorston2025-06-292-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8e6991733 (ash: fix 'read' shell built-in (1)) noted discrepancies between upstream BusyBox, busybox-w32 and bash. It aligned busybox-w32 with upstream BusyBox. Apply further changes in busybox-w32 to align 'read' more closely with bash. - When a timeout occurs before a newline in the input stream, capture and save the text collected so far. - Return an exit code of 142 on timeout. Also, since our implementation of poll(2) never sets errno to EINTR the code to handle this case can be omitted. Saves 16 bytes in the 64-bit build, adds 16 in 32-bit. (GitHub issue #502)
* | truncate: make new region of file sparseRon Yorston2025-06-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | On Linux when 'truncate' is used to create or extend a file the new region is sparse. Do the same on Windows. If the file is really being truncated, do not change its sparseness. Adds 144 bytes. (GitHub issue #501)
* | Merge pull request #498 from rfl890/masterRon Yorston2025-06-129-9/+155
|\ \ | | | | | | Add a Windows CNG backend for hash_md5_sha
| * | format #definesRFL8902025-06-091-8/+8
| | |
| * | Use Windows library for cryptographic checksumscng_backendRon Yorston2025-06-099-9/+155
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Add a new feature to libbb, FEATURE_USE_CNG_API, which enables the use of the Cryptography API: Next Generation library to calculate checksums. It is disabled by default except in the mingw64u default config, as the API requires Windows 10+ to function. Usage of this API provides a size benefit and delegates hardware optimizations to the operating system cryptography library. Based on GitHub PR #498 by rfl890. Saves 4064 bytes in the mingw64u case.
* | win32: update implementation of select(2)Ron Yorston2025-05-261-2/+5
| | | | | | | | | | | | | | | | Apply gnulib commit 034af0e401 (select, pselect: Fix test failure on native Windows). * lib/select.c (rpl_select): Fail if nfds is out-of-range. * lib/pselect.c (pselect): Likewise.
* | win32: update implementation of strptime(3)Ron Yorston2025-05-261-18/+18
| | | | | | | | Changes are mostly cosmetic.
* | win32: update inet_pton(3) implementationRon Yorston2025-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply musl commit 7e13e5ae (inet_pton: fix uninitialized memory use for IPv4-mapped IPv6 addresses). When a dot is encountered, the loop counter is incremented before exiting the loop, but the corresponding ip array element is left uninitialized, so the subsequent memmove (if "::" was seen) and the loop copying ip to the output buffer will operate on an uninitialized uint16_t. The uninitialized data never directly influences the control flow and is overwritten on successful return by the second half of the parsed IPv4 address. But it's better to fix this to avoid unexpected transformations by a sufficiently smart compiler and reports from UB-detection tools. Adds 16 bytes.
* | win32: update glob(3) implementationRon Yorston2025-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Apply musl commit 79bdacff (glob: fix wrong return code when aborting before any matches). when the result count was zero, glob was ignoring a possible GLOB_ABORTED error code and returning GLOB_NOMATCH. whether this happened could be nondeterministic and dependent on the order of dirent enumeration, in cases where multiple matches were present and only some produced errors.
* | Merge branch 'busybox' into mergeRon Yorston2025-05-1920-119/+286
|\|
| * cpio: error out if the file to be achived is >=4GBDenys Vlasenko2025-04-211-0/+6
| | | | | | | | | | | | | | | | | | | | function old new delta .rodata 105715 105751 +36 cpio_o 1145 1167 +22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 58/0) Total: 58 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * rpm2cpio: extract cpio even if compression is not knownDenys Vlasenko2025-04-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | This is more useful than failing outright. function old new delta rpm2cpio_main 110 144 +34 .rodata 105681 105715 +34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 68/0) Total: 68 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/archival: make setup_unzip_on_fd() return bytes read if not compressedDenys Vlasenko2025-04-207-23/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup_unzip_on_fd() does not return the transformer structure, so the user does not know how much to seek back (or alternatively what the signature was) when compressor signature is not detected. Currently not needed (the only user is tar which dies anyway). However, rpm2cpio may need this if we extend it to extract the internal .cpio even if cpio's compressions algo is not known. function old new delta setup_unzip_on_fd 53 59 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * runit: fix setuidgid help textJ. Neuschäfer2025-04-171-1/+2
| | | | | | | | | | Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * archival: disallow path traversals (CVE-2023-39810)Denys Vlasenko2025-04-165-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create new configure option for archival/libarchive based extractions to disallow path traversals. As this is a paranoid option and might introduce backward incompatibility, default it to no. Fixes: CVE-2023-39810 Based on the patch by Peter Kaestle <peter.kaestle@nokia.com> function old new delta data_extract_all 921 945 +24 strip_unsafe_prefix 101 102 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * syslogd: Fix 'OPT_locallog' check regression in 'syslogd_main'Grant Erickson2025-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the recent refactoring of 'syslogd_main', a regression was introduced in handling the manual bitwise OR of 'OPT_locallog' as follows: if (ENABLE_FEATURE_REMOTE_LOG && !(opts & OPT_remotelog)) // -R option_mask32 |= OPT_locallog; 'opts' represents the locally-scoped output of 'getopt32' and 'option_mask32' represents the globally-scoped state of the same. Consequently, the above performs a bitwise OR to include 'OPT_locallog' of the globally-scoped option state, which 'opts' will not reflect locally. Manipulating the global, rather than local, state is correct as 'timestamp_and_log_internal' will later need to check 'OPT_locallog'. However, when the aforementioned refactor occurred, the following regressing change was made: - if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) { + if (!ENABLE_FEATURE_REMOTE_LOG || (opts & OPT_locallog)) { breaking the spatially- and temporally-removed check in 'timestamp_and_log_internal'. Fixes: 02378ce20c6d2 ("syslogd: decrease stack usage, ~50 bytes") function old new delta syslogd_init 1140 1137 -3 Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpd: send DHCPOFFERs as unicast (unless clients specifically asks for bcast)Denys Vlasenko2025-04-071-16/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 2131 says we should do that. Evidently, since for so many years no one complained, sending them broadcast works too, but finally we've got someone who wants RFC-compliand behavior. function old new delta send_packet 141 179 +38 .rodata 105680 105681 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 39/0) Total: 39 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Makefile: fix passing of EXTRA_LDLIBSDenys Vlasenko2025-04-061-1/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * init: improve log message when a process exits: show exit codeSébastien Parisot2025-04-061-3/+15
| | | | | | | | | | | | | | | | | | | | | | function old new delta .rodata 105649 105680 +31 init_main 776 804 +28 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0) Total: 59 bytes Signed-off-by: Sébastien Parisot <sparisot@free-mobile.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: fix copy-paste error in "generate a consistent IAID" commitDenys Vlasenko2025-02-091-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: generate a consistent IAIDZhou Siqi2025-02-091-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, udhcpc6 does not meet the requirements for Identity Association in RFC 3315. This is a specific explanation in RFC 3315 protocol: https://datatracker.ietf.org/doc/html/rfc3315#section-10 "The IAID uniquely identifies the IA and must be chosen to be unique among the IAIDs on the client. The IAID is chosen by the client. For any given use of an IA by the client, the IAID for that IA MUST be consistent across restarts of the DHCP client." This patch makes the client generate a consistent IAID based on the MAC address. function old new delta send_d6_discover 285 270 -15 Signed-off-by: Zhou Siqi <zhousiqi5@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: move block comment, no code changesDenys Vlasenko2025-02-091-61/+61
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: improvementsLaurent Bercot2025-02-092-32/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several small improvements to udhcpc6. - Remove usage text for the nonexistent -B option. - Fix a segfault when renewing an IA_PD lease without IA_NA (which means the client hasn't been assigned an ip, so we cannot locally bind to it). - Fix NAK management: check the option length, and print the status code and status message - Add a -m option to always send renew requests as multicast. These last two changes are useful to deal with hopelessly broken DHCPv6 servers such as the one from the Orange Livebox (one of the main French ISPs) which I'm currently having the displeasure to have to talk to, hence the patch. function old new delta static.send_d6_renew - 126 +126 .rodata 105598 105649 +51 udhcpc6_main 2607 2650 +43 packed_usage 34933 34953 +20 d6_send_kernel_packet_from_client_data_ifindex 266 282 +16 send_d6_renew 174 - -174 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 4/0 up/down: 256/-174) Total: 82 bytes Signed-off-by: Laurent Bercot <ska-dietlibc@skarnet.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>