aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt_sha.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-07-04diff: code shrinkDenys Vlasenko1-1/+1
function old new delta diffreg 1317 1307 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-04shell: empty HISTFILE disables history saving, just as unset one didDenys Vlasenko3-4/+6
The rationale here is that unsetting HISTFILE in /etc/profile does not "stick": if it's unset, the default one is set later (after /etc/profile is executed) by the shell. But setting (and exporting, so it is inherited by all (grand)child shells) an empty one works. function old new delta save_history 296 316 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-03shell: update HISTFILESIZE code to be actually usefulDenys Vlasenko6-58/+120
"HISTFILESIZE=0" in profile wasn't working as intended, "unset HISTFILE" wasn't preventing creation of history files Now: HISTSIZE=n allows to reduce in-memory history buffer HISTFILESIZE=n allows to reduce history file size (0: truncate it) unset HISTFILE allows to not save history file at all function old new delta exitshell 138 194 +56 hush_exit 97 143 +46 save_history 266 296 +30 hush_main 1170 1186 +16 .rodata 105762 105771 +9 load_history 246 254 +8 size_from_HISTFILESIZE 44 41 -3 read_line_input 2746 2712 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/2 up/down: 165/-37) Total: 128 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-02shell: fix race between signal handlers setting bb_got_signal and poll()Denys Vlasenko8-13/+66
function old new delta __ppoll_time64 - 211 +211 check_got_signal_and_poll - 164 +164 read_key 607 601 -6 shell_builtin_read 1328 1318 -10 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 0/2 up/down: 375/-16) Total: 359 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-02use pollfd[1] array for poll() argumentDenys Vlasenko2-7/+8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-02cpio: map -F to --file long optionSertonix1-0/+1
function old new delta .rodata 100437 100444 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 7/0) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01libbb: Prevent clang from reading the G pointer before it is assignedBin Meng2-20/+23
It was observed that getty crashes on RISC-V 64-bit target, with the busybox binary compiled by clang/LLVM 17 with -O2. Not only getty, but also some other applets like syslogd/vi are broken too. Commit 5156b245 ("Make const ptr assign as function call in clang") introduced XZALLOC_CONST_PTR() to defeat the compiler optimization, however it only fixed a small number of broken places when compiling busybox with clang/LLVM. A large number of places remain broken. This commit treats ASSIGN_CONST_PTR() the same way as XZALLOC_CONST_PTR(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01shell: improve bash compatibility of read built-inRon Yorston11-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>
2025-07-01df: -k overrides block size to 1k even if $POSIXLY_CORRECTDenys Vlasenko1-2/+5
function old new delta df_main 1060 1070 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01hexdump: add tests for %x, handle little/big endian properlyRadoslav Kolev1-22/+69
Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01od: make -B test little endian only, add variant for big endianRadoslav Kolev1-1/+12
Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01hexdump: fix regression for uint16 on big endian systemsRadoslav Kolev1-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>
2025-07-01ntpd: Raise MAXDIST to 3s for better tolerance and consistency with chronyMichael Glembotzki1-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>
2025-07-01ip route: make cache printing a bit more similar to upstreamDenys Vlasenko1-9/+7
function old new delta print_route 1573 1565 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01lineedit: fix left-over print to stdoutAhmad Fatoum1-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>
2025-07-01lineedit: fix printing lines during tab completionAhmad Fatoum1-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>
2025-04-21cpio: error out if the file to be achived is >=4GBDenys Vlasenko1-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>
2025-04-20rpm2cpio: extract cpio even if compression is not knownDenys Vlasenko1-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>
2025-04-20libbb/archival: make setup_unzip_on_fd() return bytes read if not compressedDenys Vlasenko7-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>
2025-04-17runit: fix setuidgid help textJ. Neuschäfer1-1/+2
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-04-16archival: disallow path traversals (CVE-2023-39810)Denys Vlasenko5-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>
2025-04-08syslogd: Fix 'OPT_locallog' check regression in 'syslogd_main'Grant Erickson1-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>
2025-04-07udhcpd: send DHCPOFFERs as unicast (unless clients specifically asks for bcast)Denys Vlasenko1-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>
2025-04-06Makefile: fix passing of EXTRA_LDLIBSDenys Vlasenko1-1/+5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-04-06init: improve log message when a process exits: show exit codeSébastien Parisot1-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>
2025-02-09udhcpc6: fix copy-paste error in "generate a consistent IAID" commitDenys Vlasenko1-1/+1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-02-09udhcpc6: generate a consistent IAIDZhou Siqi1-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>
2025-02-09udhcpc6: move block comment, no code changesDenys Vlasenko1-61/+61
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-02-09udhcpc6: improvementsLaurent Bercot2-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>
2024-12-21cut: code shrinkDenys Vlasenko1-6/+5
move "linenum" manipulations to the one place where it is used. function old new delta cut_main 1373 1360 -13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-21cut: code shrinkDenys Vlasenko1-9/+13
This change eliminates one temporary: - if (dcount++ < cut_list[cl_pos].startpos) + dcount++; + if (dcount <= cut_list[cl_pos].startpos) function old new delta cut_main 1402 1373 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-20cut: fix up -D/-s behavior with -FDenys Vlasenko2-5/+36
function old new delta cut_main 1388 1402 +14 packed_usage 34934 34933 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-1) Total: 13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-20cut: remove unnecessary initialization of regmatch_tDenys Vlasenko1-1/+1
function old new delta cut_main 1404 1388 -16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-16cut: shorten error messages on bad syntax even moreDenys Vlasenko1-10/+6
$ cut -s -b3 cut: -s requires -f or -F $ cut -d@ -b3 cut: -d DELIM requires -f or -F function old new delta static.requires_f - 19 +19 static._op_on_field 32 - -32 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/0 up/down: 19/-32) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-16cut: shorten error messages on bad syntaxDenys Vlasenko1-3/+3
We don't need to mimic GNU cut error messages. $ cut -d@ -b3 cut: -d DELIM makes sense only with -f or -F $ cut -s -b3 cut: -s makes sense only with -f or -F function old new delta static._op_on_field 31 32 +1 .rodata 105659 105598 -61 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-61) Total: -60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-16cut: terminate cut_list[] so that we don't need "size of the array" variableDenys Vlasenko1-20/+25
function old new delta cut_main 1410 1404 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-16cut: we can't get empty cut_list[], remove the check for thatDenys Vlasenko1-8/+11
function old new delta .rodata 105685 105659 -26 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-15cut: disallow -f '' and -f '-'Denys Vlasenko1-15/+19
function old new delta cut_main 1391 1410 +19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-14cut: fix -F n-m to match toyboxDenys Vlasenko2-3/+28
function old new delta cut_main 1339 1391 +52 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: simplify getopt32 codeDenys Vlasenko1-11/+8
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: "it's legal to pass an empty list" seems to be untrueDenys Vlasenko1-46/+44
function old new delta cut_main 1344 1339 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: whitespace fixesDenys Vlasenko1-3/+3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: tweak commentsDenys Vlasenko1-3/+2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: fix handling of -d ''Denys Vlasenko2-1/+13
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-13cut: prevent infinite loop if -F REGEX matches empty delimiterDenys Vlasenko1-1/+3
function old new delta cut_main 1339 1348 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-11cut: tweak --helpDenys Vlasenko2-11/+10
function old new delta packed_usage 34901 34934 +33 cut_main 1353 1339 -14 .rodata 105724 105685 -39 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 33/-53) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-10cut: fix -d$'\n' --output-delimiter=@@ behaviorDenys Vlasenko2-7/+53
function old new delta cut_main 1261 1353 +92 packed_usage 34925 34901 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 92/-24) Total: 68 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-10cut: implement --output-delimiterDenys Vlasenko2-10/+49
function old new delta cut_main 1204 1261 +57 static.cut_longopts - 20 +20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-10cut: with -F disabled in .config, don't show it in --helpDenys Vlasenko1-5/+13
function old new delta packed_usage 34897 34849 -48 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-10cut: comment out code which seems to be not neededDenys Vlasenko1-7/+7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>