aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * seedrng: simplify read_new_seed() to not have error returnDenys Vlasenko2022-04-301-14/+17
| | | | | | | | | | | | | | gcc in fact detects this and does this transformation when generating code - no object code changes. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: prepare read_new_seed() to not need a "success" retvalDenys Vlasenko2022-04-301-10/+12
| | | | | | | | | | | | | | | | | | | | | | We do not expect /dev/[u]random to be not openable/readable. If they are, just bail out (something is obviously very wrong). function old new delta seedrng_main 1077 1076 -1 .rodata 104939 104929 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: do not try to continue on unexpected errors (just exit)Denys Vlasenko2022-04-301-38/+16
| | | | | | | | | | | | | | | | | | | | function old new delta .rodata 104946 104938 -8 seedrng_main 1225 1077 -148 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-156) Total: -156 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ifplugd: split -a into -a and -A, latter disables upping in iface creationDenys Vlasenko2022-04-301-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -a meant both "don't up iface before each link detection" and "don't up iface when it newly appears". But they are not the same. I have a dock station where eth1 appears when I attach the notebook to it (looks like it's hanging off a USB bus). IOW: appearance of this interface is functionally equivalent to attaching ethernet cable. ifplugd meant to be able to *automatically* handle this case. Currently, with -a, it couldn't: newly appearing iface stayed down, user had to manually up it. function old new delta packed_usage 34253 34296 +43 .rodata 104876 104877 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 44/0) Total: 44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: chdir to the SEED_DIRECTORY - avoid concat_path_file'sDenys Vlasenko2022-04-271-9/+9
| | | | | | | | | | | | | | function old new delta seedrng_main 1273 1225 -48 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: shorten stringsDenys Vlasenko2022-04-271-11/+11
| | | | | | | | | | | | | | function old new delta .rodata 104894 104876 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: remove unnecessary zero-filling of local variablesDenys Vlasenko2022-04-271-8/+11
| | | | | | | | | | | | | | function old new delta seedrng_main 1292 1273 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: remove unnecessary zero-filling of local variablesDenys Vlasenko2022-04-271-5/+5
| | | | | | | | | | | | | | function old new delta seedrng_main 1323 1292 -31 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * seedrng: shrink --help textDenys Vlasenko2022-04-271-3/+3
| | | | | | | | | | | | | | function old new delta packed_usage 34280 34253 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: fix fallout from nth_string() robustification, closes 14726Denys Vlasenko2022-04-271-1/+13
| | | | | | | | | | | | | | function old new delta parse_common 187 228 +41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * kbuild: Prefer -Oz over -OsBernhard Reutner-Fischer2022-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Oz Optimize aggressively for size rather than speed. with gcc-12 so far (i think only https://gcc.gnu.org/PR32803 and 103773 ) "shorter load imm on x86_64": (add/remove: 0/0 grow/shrink: 4/1670 up/down: 6/-13196) Total: -13190 bytes text data bss dec hex filename 975753 4227 1816 981796 efb24 busybox_old 962442 4227 1816 968485 ec725 busybox_unstripped with clang-15: (add/remove: 394/34 grow/shrink: 161/1856 up/down: 18644/-98946)Total: -80302 bytes text data bss dec hex filename 1120994 16066 1696 1138756 116044 busybox_old 1040689 16026 1696 1058411 10266b busybox_unstripped Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: prune header includesJason A. Donenfeld2022-04-241-14/+0
| | | | | | | | | | | | | | | | | | Remove redundant includes. We have platform specific handling in libbb.h and platform.h so we can handle quirks in a central place. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: code-golf even smallerJason A. Donenfeld2022-04-241-28/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we're passing 0 as the timeout, we don't need safe_poll. Remove cleanup at end of program, since OS does that, which lets us simplify control flow. Factor repeated function calls into ternary loop. function old new delta seedrng_main 1061 1459 +398 seed_from_file_if_exists 468 - -468 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 398/-468) Total: -70 bytes text data bss dec hex filename 1052781 16515 1816 1071112 105808 busybox_old 1052711 16515 1816 1071042 1057c2 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * kbuild: fix building sha256Bernhard Reutner-Fischer2022-04-212-8/+1
| | | | | | | | | | | | | | | | | | | | | | Pass down the correct EXTRA_CFLAGS to the compiler driver when building assembler source. Otherwise building busybox for a multilib other than the default failed to link since hash_md5_sha256_x86-64_shaNI.o and hash_md5_sha_x86-64_shaNI.o were built for the default arch which might not what we requested in the EXTRA_CFLAGS. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * vi: fix backspace over tab in commandsRon Yorston2022-04-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Colon and search commands are entered on the status line. Since the cursor position wasn't being tracked backspacing over a tab resulted in a mismatch between the actual and apparent content of the command. function old new delta get_input_line 178 180 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 2/0) Total: 2 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: compress format strings with %s argumentsJason A. Donenfeld2022-04-201-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid an xstrdup call with seed_dir. - Compress format strings with %s arguments. - Open /dev/urandom for add entropy ioctl rather than /dev/random, so that /dev/random is only used for the already-sightly-flawed poll() check for creditability. function old new delta seedrng_main 948 958 +10 seed_from_file_if_exists 410 417 +7 .rodata 108338 108206 -132 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 17/-132) Total: -115 bytes text data bss dec hex filename 975829 4227 1816 981872 efb70 busybox_old 975714 4227 1816 981757 efafd busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: avoid needless runtime strlen() callJason A. Donenfeld2022-04-201-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid needless runtime strlen() call, bloating binary. - Replace failed seed string with series of nulls. function old new delta .rodata 108350 108338 -12 static.seedrng_prefix 26 - -26 seedrng_main 1000 948 -52 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-90) Total: -90 bytes text data bss dec hex filename 975919 4227 1816 981962 efbca busybox_old 975829 4227 1816 981872 efb70 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: use predefined strings where possibleJason A. Donenfeld2022-04-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use predefined strings where possible. - Open /dev/random with O_RDONLY for ioctl(). function old new delta seed_from_file_if_exists 413 410 -3 .rodata 108407 108350 -57 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-60) Total: -60 bytes text data bss dec hex filename 975979 4227 1816 982022 efc06 busybox_old 975919 4227 1816 981962 efbca busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: further reduce sizeJason A. Donenfeld2022-04-201-55/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove all games with errno to further reduce code size. - Combine error messages that don't benefit from being separated. - Lock directory fd instead of separate file. function old new delta static.longopts 38 26 -12 seed_from_file_if_exists 426 413 -13 packed_usage 34519 34480 -39 .rodata 108484 108407 -77 seedrng_main 1088 1000 -88 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-229) Total: -229 bytes text data bss dec hex filename 976208 4227 1816 982251 efceb busybox_old 975979 4227 1816 982022 efc06 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: remove some global variablesJason A. Donenfeld2022-04-201-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove global variables and pass dfd by value, opened once instead of twice, which shaves off some more bytes. function old new delta seedrng_main 1086 1088 +2 seed_dir 8 - -8 non_creditable_seed 8 - -8 lock_file 8 - -8 creditable_seed 8 - -8 seed_from_file_if_exists 456 426 -30 ------------------------------------------------------------------------------ (add/remove: 0/4 grow/shrink: 1/1 up/down: 2/-62) Total: -60 bytes text data bss dec hex filename 976236 4227 1848 982311 efd27 busybox_old 976208 4227 1816 982251 efceb busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: hoist bb_strtoul out of min/maxJason A. Donenfeld2022-04-201-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Hoist bb_strtoul out of min/max to prevent quadruple evaluation. - Don't use separate variables for boottime/realtime. - Make use of ENABLE_FEATURE_CLEAN_UP where appropriate. - Order hash initialization after lock taking per Bernhard's taste. - Add comment description of theory of operation. function old new delta seed_from_file_if_exists 533 456 -77 seedrng_main 1218 1086 -132 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-209) Total: -209 bytes text data bss dec hex filename 976445 4227 1848 982520 efdf8 busybox_old 976236 4227 1848 982311 efd27 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: use libbb functionsJason A. Donenfeld2022-04-201-89/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make extensive use of libbb.h functions, which simplify a lot of code and reduce binary size considerably. - Use the already existing PID_FILE_PATH variable. function old new delta seed_from_file_if_exists 697 533 -164 .rodata 108665 108484 -181 seedrng_main 1463 1218 -245 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-590) Total: -590 bytes text data bss dec hex filename 977035 4227 1848 983110 f0046 busybox_old 976445 4227 1848 982520 efdf8 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * seedrng: import SeedRNG utility for kernel RNG seed filesJason A. Donenfeld2022-04-201-0/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RNG can't actually be seeded from a shell script, due to the reliance on ioctls and the fact that entropy written into the unprivileged /dev/urandom device is not immediately mixed in, making subsequent seed reads dangerous. For this reason, the seedrng project provides a basic "C script" meant to be copy and pasted into projects like Busybox and tweaked as needed: <https://git.zx2c4.com/seedrng/about/>. The SeedRNG construction has been part of systemd's seeder since January, and recently was added to Android, OpenRC, and Void's Runit, with more integrations on their way depending on context. Virtually every single Busybox-based distro I have seen seeds things in wrong, incomplete, or otherwise dangerous way. For example, fixing this issue in Buildroot requires first for Busybox to have this fix. This commit imports it into Busybox and wires up the basic config. The utility itself is tiny, and unlike the example code from the SeedRNG project, we can re-use libbb's existing hash functions, rather than having to ship a standalone BLAKE2s, which makes this even smaller. function old new delta seedrng_main - 1463 +1463 .rodata 107858 108665 +807 seed_from_file_if_exists - 697 +697 packed_usage 34414 34519 +105 static.longopts - 38 +38 static.seedrng_prefix - 26 +26 seed_dir - 8 +8 non_creditable_seed - 8 +8 lock_file - 8 +8 creditable_seed - 8 +8 applet_names 2747 2755 +8 applet_main 3192 3200 +8 ------------------------------------------------------------------------------ (add/remove: 9/0 grow/shrink: 4/0 up/down: 3184/0) Total: 3184 bytes text data bss dec hex filename 973776 4219 1816 979811 ef363 busybox_old 977035 4227 1848 983110 f0046 busybox_unstripped Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | lineedit: case-insensitive matching for '~'Ron Yorston2022-05-111-0/+4
| | | | | | | | | | | | | | | | Use case-insensitive matching when determining if the directory name in the prompt can be shortened using '~'. This doesn't seem to have been a problem, as directories are often canonicalized, but it doesn't have any great cost.
* | win32: make default PATH more likely to workRon Yorston2022-05-101-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The default PATH defined as BB_PATH_ROOT_PATH is used: - to set PATH in the shell if the environment variable doesn't exist; - as the default in 'which' if there's no PATH env var; - when the option 'command -p' is given. Replace the Unix-centric default with something more likely to work on Microsoft Windows. No guarantees, though. (GitHub issue #253)
* | ash: code shrinkRon Yorston2022-05-101-2/+1
| | | | | | | | | | Changing one of the constants used by is_bb_var() saves a few bytes in the 32-bit build.
* | ash: export certain variables to the environment immediatelyRon Yorston2022-05-086-6/+60
| | | | | | | | | | | | | | | | | | | | | | The environment variables BB_OVERRIDE_APPLETS, BB_SKIP_ANSI_EMULATION and BB_SYSTEMROOT affect of the behaviour of the shell itself. Setting them as shell variables is insufficient for them to affect the current shell. When these three variables are exported from the shell they are now placed in the environment immediately. Conversely, when they're unset or unexported they're removed from the environment.
* | win32: fix 'cd' to symlink with relative path as targetRon Yorston2022-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 69d328022 (win32: track current directory of mapped drives) replaced a call to xmalloc_realpath() with one to xmalloc_readlink(). This was incorrect. Although the argument is now guaranteed to be a symlink it's still necessary to resolve it to an absolute path. Otherwise the fix in commit 585d17d26 (win32: canonicalize path in chdir(2)) doesn't work for symlinks with a relative path as their target. (GitHub issue #147)
* | ash: don't set OLDPWD on startupRon Yorston2022-05-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Commit f9b753e70 (ash: set current working directory on startup) set the current working directory of an interactive, non-login shell during startup to ensure drives mapped to a network share and symlinks were reported correctly. It had the side effect of setting OLDPWD. This is unnecessary because the current working directory won't have changed. (GitHub issue #253)
* | win32: allow preference for applets to be disabled at runtimeRon Yorston2022-05-064-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default busybox-w32 configuration enables the PREFER_APPLETS and SH_STANDALONE features. Sometimes it may be desirable to override the default preference for applets, for example, if an applet needs to be replaced by an external program with additional features. Add support for the environment variable BB_OVERRIDE_APPLETS. Its value may be: - a single dash ('-'): all applets are overridden; - a space-separated list of names: only the specified applets are overridden.
* | win32: search PATH for missing Unix-style executablesRon Yorston2022-05-064-59/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 41ef232fc5 (win32: use built-in applets for non-existent binaries with Unix-style paths) alters what happens when trying to find an executable. If all of the following apply: - the pathname starts with one of the standard directories for Unix executables (/bin, /usr/bin, /sbin, /usr/sbin); - the file isn't found relative to the system root; - the basename matches an applet then the applet is run. Further extend the procedure so that if the first two conditions are met and either: - the PREFER_APPLETS and SH_STANDALONE features are enabled and the basename *doesn't* match an applet or - the PREFER_APPLETS and SH_STANDALONE features are disabled then PATH is searched for the basename. This affects: - how interpreters and binaries are spawned by mingw_spawn_interpreter() and mingw_spawnvp(); - how 'which' and the shell search for binaries. Special steps need to be taken in the shell to avoid treating shell built-ins and functions as applets. As a consequence of this change: - An executable that isn't an applet, say curl.exe, can be run as /usr/bin/curl so long as it's in a directory in PATH. It doesn't have to be in C:/usr/bin. - If the PREFER_APPLETS and SH_STANDALONE features are disabled binaries can be run using paths referring to standard Unix directories even if they're installed elsewhere in PATH.
* | win32: better fix for empty environment variablesRon Yorston2022-05-053-9/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears the CRT and OS each have a copy of the environment. mingw_putenv() fools the CRT into accepting an empty environment variable by calling _putenv("V=0") then truncating the new value by hand. But _putenv() also updates the OS environment with the fake 'V=0' value. Commit 5b48ca53b (win32: pass NULL to spawnve, not environ) resulted in this fake value being used and hence empty variables getting the value '0'. - Add a call to SetEnvironmentVariable() in mingw_putenv() to update the OS environment. - Restore the use of NULL environment pointers in mingw_spawnvp(). - Add a test. (GitHub issue #250)
* | win32: revert changes related to environment variablesRon Yorston2022-05-042-12/+21
| | | | | | | | | | | | | | | | | | | | Revert the change to mingw_putenv() in the previous commit. When compiling for MSVCRT (i.e. not for UCRT) revert some of the changes from commit 5b48ca53b (win32: pass NULL to spawnve, not environ). (GitHub issue #250)
* | win32: new code to set empty environment variableRon Yorston2022-05-031-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows environment variables: a never-ending source of fun. It seems the recent hack to work around problems in UCRT breaks the hack to set empty environment variables. The change to the empty variable isn't reflected in the environment seen by the C runtime. Use the WIN32 API to set the empty variable then set a dummy variable to make the C runtime take notice. (GitHub issue #250)
* | which,ash: changes to which/command/typeRon Yorston2022-05-014-23/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change how 'which' detects if it was run from a standalone shell: the shell passes the undocumented '-s' option. This is stricter and more reliable than the previous method of checking the name of the binary. Add a function to determine the binary associated with a given applet name. This makes it possible for 'which' and 'command -v' to list the correct binary even for applets other than 'busybox'. For example, when the binary is called 'sh.exe' 'which sh' will report its path. In standalone shell mode 'command -V' and 'type' now report "xxx is a builtin applet" rather than "xxx is xxx", which is true but not very illuminating. (GitHub issue #248)
* | win32: clarify documentation of is_relative_path()Ron Yorston2022-04-301-3/+8
| |
* | reset: applet should be NOEXEC for POSIXRon Yorston2022-04-301-1/+2
| | | | | | | | | | | | | | | | | | The 'reset' applet was changed to be NOFORK for WIN32. Ensure that it remains NOEXEC in the POSIX build. The default POSIX configuration doesn't enable any of the features which need this information (PREFER_APPLETS, SH_STANDALONE and SH_NOFORK).
* | ash: avoid misleading '.exe' in standalone shell modeRon Yorston2022-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In dash a command with an explicit path has an index value of -1 in its cmdentry structure. Upstream BusyBox extends this to allow other negative values for applets in standalone shell mode. busybox-w32 adds a further extension, with the index value INT_MIN indicating an applet with a Unix-style path. In describe_command() the command should only have a '.exe' extension added for index == -1, the original dash case of an explicit path. (GitHub issue #248)
* | win32: conditional compilation in process.cRon Yorston2022-04-241-10/+10
| | | | | | | | | | | | | | Drop the use of ENABLE_FEATURE_SH_STANDALONE in process.c In mingw_spawn_interpreter() check for an applet *before* trying to run the interpreter using the path provided.
* | win32: proper conditional compilation in popen.cRon Yorston2022-04-231-9/+14
| | | | | | | | | | | | | | | | | | | | | | In mingw_fork_compressor() the code to prefer applets over external programs should be conditionally compiled based on the setting of ENABLE_FEATURE_PREFER_APPLETS. In mingw_popen() there's no need to use ENABLE_FEATURE_SH_STANDALONE for the same purpose. ENABLE_FEATURE_PREFER_APPLETS is sufficient. Save a few bytes by sharing a format string in mingw_fork_compressor().
* | date: enable FEATURE_DATE_NANORon Yorston2022-04-225-2/+16
| | | | | | | | | | | | | | | | | | Provide a WIN32 implementation of clock_gettime(2), though only with support for CLOCK_REALTIME. This makes it possible to enable FEATURE_DATE_NANO which adds support for the %N date format. MinGW-w64 has clock_gettime(2) but it's in the winpthreads library and we don't want to bother with that.
* | win32: minor adjustments to file permissionsRon Yorston2022-04-192-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Mask the file permission bits in mingw_umask(), not when it's called from run_applet_no_and_exit(). Rather than hardcode write permissions for group and other in file_attr_to_st_mode() and mingw_fstat() make them respect the current umask setting. In mingw_fstat() there's no need to check the mode using S_ISDIR(): the hardcoded mode doesn't set S_IFDIR. The compiler had already figured this out so there's no reduction in bloat.
* | Update default configurationRon Yorston2022-04-072-62/+76
| |
* | Merge branch 'busybox'Ron Yorston2022-04-0714-133/+196
|\|
| * vi: improved handling of backspace in replace modeRon Yorston2022-03-041-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In replace mode ('R' command) the backspace character should get special treatment: - backspace only goes back to the start of the replacement; - backspacing over replaced characters restores the original text. Prior to this commit BusyBox vi deleted the characters both before and after the cursor in replace mode. function old new delta undo_pop - 235 +235 char_insert 858 884 +26 indicate_error 81 84 +3 find_range 654 657 +3 static.text_yank 77 79 +2 do_cmd 4486 4243 -243 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/1 up/down: 269/-243) Total: 26 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * taskset: fix printf format mismatch in !FEATURE_TASKSET_FANCY config. closes ↵Denys Vlasenko2022-03-011-2/+1
| | | | | | | | | | | | 14616 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: do not truncate failed tilde expansion on unknown user namesDenys Vlasenko2022-03-011-3/+1
| | | | | | | | | | | | | | | | | | | | | | Do not skip over "*p = c;" statement. Testcase: echo ~~nouser/qwe function old new delta argstr 1396 1406 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix unsafe use of mempcpyDenys Vlasenko2022-03-011-1/+7
| | | | | | | | | | | | | | function old new delta subevalvar 1549 1557 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: don't read past end of var in subvareval for bash substitutionsSören Tempel2022-03-015-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, BusyBox handles bash pattern substitutions without a terminating '/' character incorrectly. Consider the following shell script: _bootstrapver=5.0.211-r0 _referencesdir="/usr/${_bootstrapver/-*}/Sources" echo $_referencesdir This should output `/usr/5.0.211/Sources`. However, without this patch it instead outputs `/usr/5.0.211Sources`. This is due to the fact that BusyBox expects the bash pattern substitutions to always be terminated with a '/' (at least in this part of subvareval) and thus reads passed the substitution itself and consumes the '/' character which is part of the literal string. If there is no '/' after the substitution then BusyBox might perform an out-of-bounds read under certain circumstances. When replacing the bash pattern substitution with `${_bootstrapver/-*/}`, or with this patch applied, ash outputs the correct value. Signed-off-by: Sören Tempel <soeren@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/sha1: update config help text with new performance numbersDenys Vlasenko2022-02-181-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>