Commit graph

2495 commits

Author SHA1 Message Date
Denys Vlasenko
e3484095f9 libbb/yescrypt: code shrink
function                                             old     new   delta
yescrypt_r                                          1063    1048     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 18:03:10 +02:00
Denys Vlasenko
5e9b95ff40 cryptpw: -m sha512crypt must also be accepted
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:42:35 +02:00
Denys Vlasenko
479d8db99f libbb/yescrypt: fix salts ending in dots (corresponding to binary zeros)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:26:47 +02:00
Denys Vlasenko
75758c7360 libbb/yescrypt: accept longer salts (up to 84 chars)
function                                             old     new   delta
cryptpw_main                                         214     223      +9
chpasswd_main                                        347     356      +9
passwd_main                                          931     934      +3
yescrypt_r                                          1084    1056     -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 21/-28)             Total: -7 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:08:32 +02:00
Denys Vlasenko
63025e8bca libbb/yescrypt: remove forgotten SHA256 HMAC header file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 10:51:13 +02:00
Denys Vlasenko
f464be22bd libbb/yescrypt: make it possible to set constant parameters, and set YESCRYPT_RW
function                                             old     new   delta
yescrypt_kdf32_body                                 1052    1420    +368
yescrypt_r                                          1133    1084     -49
static.smix                                          762       -    -762
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 368/-811)         Total: -443 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 10:39:14 +02:00
Denys Vlasenko
c11730490a libbb/yescrypt: remove redundant SHA256 HMAC implementation
function                                             old     new   delta
hmac_blocks                                            -      88     +88
static.PBKDF2_SHA256                                 176     213     +37
yescrypt_kdf32_body                                 1046    1052      +6
static.smix                                          759     762      +3
hmac_block                                            88      64     -24
HMAC_SHA256_Final                                     53       -     -53
HMAC_SHA256_Buf                                       58       -     -58
HMAC_SHA256_Init                                     159       -    -159
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 3/1 up/down: 134/-294)         Total: -160 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 08:21:44 +02:00
Denys Vlasenko
1a0913d57c libbb: factor out HMAC code from TLS
function                                             old     new   delta
hmac_block                                             -      88     +88
hmac_peek_hash                                         -      61     +61
hmac_end                                               -      50     +50
hmac_begin                                           140     177     +37
hmac_hash_v                                            -      30     +30
.rodata                                           105799  105787     -12
hmac_sha_precomputed                                  54       -     -54
hmac_sha_precomputed_v                                69       -     -69
hmac                                                  83       -     -83
------------------------------------------------------------------------------
(add/remove: 5/3 grow/shrink: 1/1 up/down: 266/-218)           Total: 48 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 07:44:01 +02:00
Denys Vlasenko
e2091c9842 libbb: add two more forgotten source files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 04:57:16 +02:00
Denys Vlasenko
a2a5db41a3 libbb/pw_ascii64.c: add forgotten source file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 00:04:10 +02:00
Denys Vlasenko
53de6e6150 libbb/yescrypt: use common ascii64 encoding routine
function                                             old     new   delta
num2str64_lsb_first                                   33      46     +13
yescrypt_r                                          1235    1133    -102
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 13/-102)           Total: -89 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 22:43:28 +02:00
Denys Vlasenko
5e17e3c6f4 libbb: shuffle ascii64 code around, shrink i2a64()
function                                             old     new   delta
num2str64_4chars_msb_first                             -      55     +55
num2str64_lsb_first                                    -      33     +33
i2a64                                                 42      25     -17
to64                                                  33       -     -33
to64_msb_first                                        55       -     -55
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/1 up/down: 88/-105)           Total: -17 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 21:59:03 +02:00
Denys Vlasenko
f3a1b7be72 libbb/yescrypt: remove one NOINLINE, add copyright headers, merge two source files
function                                             old     new   delta
pw_encrypt                                           945     974     +29
yes_crypt                                             50       -     -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 29/-50)            Total: -21 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 20:59:00 +02:00
Denys Vlasenko
0574928c85 libbb/yescrypt: remove unused prefetching code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 20:08:53 +02:00
Denys Vlasenko
aebe6f7132 libbb/yescrypt: remove inlines (whcih gcc detects anyway) and dead ifderfs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:47:29 +02:00
Denys Vlasenko
447eb6bf71 libbb: in DES crypt, error out on invalid salt chars
function                                             old     new   delta
des_crypt                                           1308    1327     +19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:30:58 +02:00
Denys Vlasenko
82bbbd2e53 libbb: code shrink in DES crypt
function                                             old     new   delta
pw_encrypt                                           941     945      +4
bits32                                               128       -    -128
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 4/-128)           Total: -124 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:14:09 +02:00
Denys Vlasenko
23b5527f5c libbb/yescrypt: use common ACSII char-to-64 conversion code
function                                             old     new   delta
a2i64                                                  -      46     +46
yescrypt_r                                          1215    1235     +20
decode64_uint32                                      167     177     +10
atoi64                                                25       -     -25
ascii_to_bin                                          53       -     -53
static.atoi64_partial                                 77       -     -77
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 2/0 up/down: 76/-155)           Total: -79 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:08:57 +02:00
Denys Vlasenko
f5af8aefea libbb/yescrypt: shrink PBKDF2
function                                             old     new   delta
static.PBKDF2_SHA256                                 189     176     -13

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 18:35:37 +02:00
Denys Vlasenko
b8f7600166 libbb/yescrypt: more efficient byteswapping
function                                             old     new   delta
static.smix1                                         631     604     -27
static.smix2                                         452     420     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-59)             Total: -59 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 18:27:16 +02:00
Denys Vlasenko
9c4cd75d12 restore mangled comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:16:43 +02:00
Denys Vlasenko
0893bc3bac libbb/yescrypt: code shrink
static.PBKDF2_SHA256                                   -     189    +189
HMAC_SHA256_Init                                       -     159    +159
HMAC_SHA256_Buf                                        -      58     +58
HMAC_SHA256_Final                                      -      53     +53
i2a64                                                  -      42     +42
yescrypt_r                                          1221    1215      -6
yescrypt_kdf32_body                                 1064    1046     -18
i64c                                                  42       -     -42
libcperciva_HMAC_SHA256_Final                         53       -     -53
libcperciva_HMAC_SHA256_Buf                           58       -     -58
ascii64                                               65       -     -65
libcperciva_HMAC_SHA256_Init                         159       -    -159
PBKDF2_SHA256                                        386       -    -386
------------------------------------------------------------------------------
(add/remove: 5/6 grow/shrink: 0/2 up/down: 501/-787)         Total: -286 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:12:13 +02:00
Denys Vlasenko
b21cd481db libbb/yescrypt: code shrink
function                                             old     new   delta
libcperciva_HMAC_SHA256_Final                         56      53      -3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:02:03 +02:00
Denys Vlasenko
62abd47815 Move "sha256-hash a memory array and produce the digest" helper to libbb
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 10:50:46 +02:00
Denys Vlasenko
4e5a6b6dbb libbb/yescrypt: remove extra sha256 implementation
function                                             old     new   delta
libcperciva_HMAC_SHA256_Init                           -     159    +159
libcperciva_HMAC_SHA256_Final                          -      56     +56
SHA256_Buf                                             -      40     +40
static.smix                                          753     759      +6
yescrypt_kdf32_body                                 1059    1060      +1
.rodata                                           105803  105799      -4
initial_state                                         32       -     -32
libcperciva_SHA256_Init                               37       -     -37
static.cpu_to_be32_vect                               51       -     -51
_HMAC_SHA256_Final                                    55       -     -55
PAD                                                   64       -     -64
libcperciva_HMAC_SHA256_Buf                          132      58     -74
libcperciva_SHA256_Buf                                86       -     -86
SHA256_Pad_Almost                                    131       -    -131
_SHA256_Final                                        195       -    -195
_SHA256_Update                                       198       -    -198
_HMAC_SHA256_Init                                    213       -    -213
Krnd                                                 256       -    -256
PBKDF2_SHA256                                       1003     386    -617
SHA256_Transform                                    3083       -   -3083
------------------------------------------------------------------------------
(add/remove: 3/12 grow/shrink: 2/3 up/down: 262/-5096)      Total: -4834 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 10:35:22 +02:00
Denys Vlasenko
ffac25d056 libbb/yescrypt: comment tweaks
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 07:43:04 +02:00
Denys Vlasenko
8be6dafe94 libbb/yescrypt: use mmap for allocation, it's large - 16Mbytes
This automatically gives it alignment sufficient for any future SIMD
optimizations.

function                                             old     new   delta
yescrypt_r                                          1217    1221      +4
yescrypt_kdf32_body                                 1077    1059     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-18)             Total: -14 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 06:50:18 +02:00
Denys Vlasenko
736589f877 libbb/yescrypt: reduce the number of function parameters
function                                             old     new   delta
yescrypt_kdf32_body                                    -    1077   +1077
static.smix                                          739     753     +14
yescrypt_init_local                                   34       -     -34
yes_crypt                                             87      50     -37
yescrypt_free_local                                   49       -     -49
yescrypt_r                                          1288    1217     -71
static.yescrypt_kdf_body                            1166       -   -1166
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 1/2 up/down: 1091/-1357)       Total: -266 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 06:05:08 +02:00
Denys Vlasenko
85d3c48217 libbb/yescrypt: code shrink in salt decoding
function                                             old     new   delta
yescrypt_r                                          1311    1288     -23

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 03:59:59 +02:00
Denys Vlasenko
1c977008e0 libbb/yescrypt: code shrink in parameter decoding
function                                             old     new   delta
decode64_uint32                                      166     167      +1
yescrypt_r                                          1342    1311     -31
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-31)             Total: -30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 03:40:06 +02:00
Denys Vlasenko
1524540613 libbb/yescrypt: remove unused variable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 03:22:46 +02:00
Denys Vlasenko
9b6e03fd09 libbb/yescrypt: remove unused yescrypt_region_t tmp
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 03:03:38 +02:00
Denys Vlasenko
e189464fa7 libbb/yescrypt: make some functions static
function                                             old     new   delta
static.yescrypt_kdf_body                               -    1166   +1166
yescrypt_r                                           692    1342    +650
atoi64                                                 -      25     +25
decode64_uint32                                      201     166     -35
encode64                                             153       -    -153
decode64                                             174       -    -174
yescrypt_kdf                                         442       -    -442
yescrypt_kdf_body                                   1239       -   -1239
------------------------------------------------------------------------------
(add/remove: 2/4 grow/shrink: 1/1 up/down: 1841/-2043)       Total: -202 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 02:39:07 +02:00
Denys Vlasenko
3d9b965b4a libbb/yescrypt: remove unused yescrypt_binary_t
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 01:35:23 +02:00
Denys Vlasenko
bf8231d11d libbb/yescrypt: remove YESCRYPT_INIT_SHARED flag and code using it
It's only used by libxcrypt-4.4.38/lib/alg-yescrypt-opt.c code
(optimized code version?) which wasn't ported to busybox

function                                             old     new   delta
yescrypt_kdf                                         449     442      -7
static.smix                                          755     739     -16
alloc_region                                          72       -     -72
yescrypt_kdf_body                                   1467    1239    -228
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/3 up/down: 0/-323)           Total: -323 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 01:29:14 +02:00
Denys Vlasenko
10196929da libbb/yescrypt: remove unreachable support for scrypt hash ("$7$...")
function                                             old     new   delta
decode64                                             136     174     +38
decode64_uint32                                      166     201     +35
atoi64                                                25       -     -25
yescrypt_r                                           879     692    -187
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 2/1 up/down: 73/-212)          Total: -139 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 01:23:37 +02:00
Denys Vlasenko
be327bed9d libbb/yescrypt: remove unused yescrypt_shared_t
function                                             old     new   delta
static.smix                                            -     755    +755
static.smix1                                           -     631    +631
static.smix2                                           -     452    +452
yescrypt_free_local                                    9      49     +40
yes_crypt                                             90      87      -3
yescrypt_r                                           890     879     -11
yescrypt_kdf                                         479     449     -30
free_region                                           47       -     -47
yescrypt_kdf_body                                   1724    1467    -257
smix2                                                659       -    -659
smix                                                 790       -    -790
smix1                                                960       -    -960
------------------------------------------------------------------------------
(add/remove: 3/4 grow/shrink: 1/4 up/down: 1878/-2757)       Total: -879 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 01:03:49 +02:00
Denys Vlasenko
444a91abc9 libbb/yescrypt: remove obviously unused, commented-out parts
No code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 00:55:08 +02:00
Denys Vlasenko
80e676664e libbb: add yescrypt password hashing support
It seems to work, but not at all optimized for size.
The extra copy of sha256 code need to be removed.

The yescrypt code in libbb/yescrypt/* is adapted from libxcrypt-4.4.38
with minimal edits, hopefully making it easier to track
backports by resetting the tree to this commit,
then comparing changes in upstream libxcrypt to the tree.

function                                             old     new   delta
blockmix_xor_save                                      -    7050   +7050
static.blockmix_xor                                    -    6475   +6475
blockmix                                               -    3390   +3390
SHA256_Transform                                       -    3083   +3083
yescrypt_kdf_body                                      -    1724   +1724
PBKDF2_SHA256                                          -    1003   +1003
smix1                                                  -     960    +960
yescrypt_r                                             -     890    +890
salsa20                                                -     804    +804
smix                                                   -     790    +790
smix2                                                  -     659    +659
blockmix_salsa8_xor                                    -     601    +601
yescrypt_kdf                                           -     479    +479
blockmix_salsa8                                        -     415    +415
Krnd                                                   -     256    +256
_HMAC_SHA256_Init                                      -     213    +213
_SHA256_Update                                         -     198    +198
_SHA256_Final                                          -     195    +195
decode64_uint32                                        -     166    +166
encode64                                               -     153    +153
decode64                                               -     136    +136
libcperciva_HMAC_SHA256_Buf                            -     132    +132
SHA256_Pad_Almost                                      -     131    +131
salsa20_simd_unshuffle                                 -     101    +101
salsa20_simd_shuffle                                   -     101    +101
yes_crypt                                              -      90     +90
libcperciva_SHA256_Buf                                 -      86     +86
crypt_make_rand64encoded                               -      85     +85
static.atoi64_partial                                  -      77     +77
alloc_region                                           -      72     +72
ascii64                                                -      65     +65
PAD                                                    -      64     +64
_HMAC_SHA256_Final                                     -      55     +55
static.cpu_to_be32_vect                                -      51     +51
free_region                                            -      47     +47
libcperciva_SHA256_Init                                -      37     +37
yescrypt_init_local                                    -      34     +34
crypt_make_pw_salt                                    92     125     +33
initial_state                                          -      32     +32
.rodata                                           105771  105803     +32
atoi64                                                 -      25     +25
explicit_bzero                                         -      22     +22
pw_encrypt                                           920     941     +21
yescrypt_free_local                                    -       9      +9
crypt_make_salt                                       85       -     -85
------------------------------------------------------------------------------
(add/remove: 43/1 grow/shrink: 3/0 up/down: 31042/-85)      Total: 30957 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 00:49:22 +02:00
Denys Vlasenko
8d3d078917 shell: empty HISTFILE disables history saving, just as unset one did
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-04 12:51:38 +02:00
Denys Vlasenko
9c46a06885 shell: update HISTFILESIZE code to be actually useful
"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-03 19:10:42 +02:00
Denys Vlasenko
36ac283682 shell: fix race between signal handlers setting bb_got_signal and poll()
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-02 22:42:47 +02:00
Denys Vlasenko
bbaa56f737 use pollfd[1] array for poll() argument
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-02 21:55:42 +02:00
Bin Meng
244f5c4795 libbb: Prevent clang from reading the G pointer before it is assigned
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-01 21:21:16 +02:00
Radoslav Kolev
f5c7cae55f hexdump: fix regression for uint16 on big endian systems
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-01 13:31:45 +02:00
Ahmad Fatoum
952a7b9cec lineedit: fix left-over print to stdout
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: fd47f05676 ("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-01 12:25:29 +02:00
Ahmad Fatoum
37abfb919d lineedit: fix printing lines during tab completion
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: fd47f05676 ("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-01 12:25:29 +02:00
Denys Vlasenko
a4894eaf71 cut: tweak --help
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-11 01:10:05 +01:00
Natanael Copa
87e60dcf0f hexdump: fix regression with -n4 -e '"%u"'
Fix bug introduced in busybox 1.37.0 that broke kernel builds.

Fixes commit e2287f99fe (od: for !DESKTOP, match output more closely
to GNU coreutils 9.1, implement -s)

function                                             old     new   delta
rewrite                                              967     976      +9

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-09 11:17:14 +01:00
Ron Yorston
175b8dda19 libbb: tidy argument checks in getopt32()
When getopt32() has complementary options it's possible to specify
the minimum and maximum number of arguments allowed.  Checking
these values was inconsistent:

- '?' correctly checked that it was followed by a digit but set
  the otherwise unused spec_flgs variable on error.

- '=' failed to check that it was followed by a digit.

function                                             old     new   delta
vgetopt32                                           1307    1319     +12

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2024-12-09 02:16:44 +01:00