aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * od: stop printing extra trailing spacesDenys Vlasenko2023-05-254-47/+51
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta .rodata 104598 104613 +15 display 1475 1485 +10 od_main 549 556 +7 rewrite 971 967 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 32/-4) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: implement -BDenys Vlasenko2023-05-252-15/+15
| | | | | | | | | | | | | | | | | | | | function old new delta .rodata 105305 105306 +1 od_main 1880 1866 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-14) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: correct -i, enable tests which pass for DESKTOP tooDenys Vlasenko2023-05-253-31/+39
| | | | | | | | | | | | | | function old new delta .rodata 105302 105305 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: for !DESKTOP, match output more closely to GNU coreutils 9.1, implement -sDenys Vlasenko2023-05-253-68/+100
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: add testsDavid Leonard2023-05-252-0/+220
| | | | | | | | | | | | | | | | * Added tests for od (non-DESKTOP little-endian) * Allow 'optional' to invert meaning of a config option with '!' Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: fix -ODavid Leonard2023-05-251-1/+1
| | | | | | | | | | | | | | | | od with option -O (4-byte octal) was incorrectly displaying 2-byte decimal when built without CONFIG_DESKTOP Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: make "false" built-inDenys Vlasenko2023-05-251-0/+7
| | | | | | | | | | | | | | | | | | | | function old new delta bltins1 384 396 +12 builtin_false - 6 +6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 18/0) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571Denys Vlasenko2023-05-259-8/+56
| | | | | | | | | | | | | | function old new delta run_list 1012 1024 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Fix for old mingw-w64 (32-bit)Ron Yorston2023-06-151-0/+3
| | | | | | | | | | | | It appears that RtlGenRandom() wasn't supported in 32-bit builds using mingw-w64 until version 7.0.0 (Fedora 33). Use the time to initialise the PRNG in earlier versions.
* | Fixes for old mingw-w64Ron Yorston2023-06-143-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Allow current busybox-w32 to build with the CentOS 6 version of mingw-w64. - Fix declaration of setlinebuf(). (GitLab issue 116) - Define ENABLE_VIRTUAL_TERMINAL_INPUT. (GitLab issue 117) - Define IO_REPARSE_TAG_APPEXECLINK. - Avoid a compiler warning in coreutils/shuf.c.
* | make: code shrinkRon Yorston2023-06-081-1/+1
| | | | | | | | Saves 8 bytes in the 32-bit build.
* | ls: code shrinkRon Yorston2023-06-071-10/+11
| |
* | ls: check whether link is hiddenRon Yorston2023-06-061-0/+17
| | | | | | | | | | | | | | | | | | | | When using 'ls -L' to list the target of a symlink (or equivalent) we must first check whether the link itself is hidden and thus subject to special treatment by the '-a' or '-A' options. Adds 80 bytes. (GitHub issue #331)
* | win32: remove special treatment of USERNAMERon Yorston2023-06-052-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 255ebaf535 (drop: adjust environment on privilege change) added USERNAME to the variables subject to special treatment when the shell starts or privilege is dropped. It's been pointed out this may not be appropriate for a variable that's Windows-specific. Remove the special treatment of USERNAME. Saves 40-48 bytes. (GitHub issue #300)
* | win32: code shrink applet look-upRon Yorston2023-06-053-31/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove find_preferred_applet_by_name(). Instead add a reference to is_applet_preferred() in find_applet_by_name(). - Remove the global variable ash_path. Use a static instead, accessed by calling get_ash_path(). - Mark ash_applet_by_name() as NOINLINE. Saves 64-96 bytes. (GitHub issue #329)
* | Example build scriptsRon Yorston2023-06-043-0/+124
| | | | | | | | | | | | Supply the scripts used to build release and prerelease busybox-w32. (GitHub issue #330)
* | win32: code shrinkRon Yorston2023-06-041-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getsysdir() wasn't used in get_proc_addr() because the former called realpath() which in turn called the latter. (Commit 4c6c8d61bc) realpath() was used to adjust the case of the path name as it was visible to the user as root's home directory. (Commit b04bbc0109) Later the home directory for "root" was changed so it no longer needed getsysdir(). (Commit 385decd6bf) The remaining uses of getsysdir() don't require the path to be canonicalised, so realpath() can be removed from getsysdir() and getsysdir() can be used in get_proc_addr(). Saves 32-64 bytes
* | ash: fix build with line editing disabledRon Yorston2023-06-041-0/+4
| | | | | | | | | | | | | | | | | | Commit 64c8f5f3d0 (ash: add support for INT trap) made some changes to the line editing code. As a result building the shell with line editing disabled fails. Add the necessary conditional compilation to restore the ability to do this.
* | win32: another BB_OVERRIDE_APPLETS fixRon Yorston2023-06-043-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for conditionally replacing applets with external commands requires the ability to check whether a given command name is present on PATH. This was being done using the PATH environment variable, which works in commands run by the shell but not in the shell itself. - The shell uses the *shell* variable PATH to look for executables. This may not be the same as the *environment* variable. - 'command -p' uses an entirely different PATH. Applet look-up in the shell is now treated as a special case, with the actual PATH being used passed to the look-up code in a global variable. This doesn't affect tab completion in the shell: whether a completion is an applet or an external command is irrelevant. Costs 152-288 bytes. (GitHub issue #329)
* | win32: fix BB_OVERRIDE_APPLETSRon Yorston2023-06-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | Now that BB_OVERRIDE_APPLETS can affect how the shell searches PATH it may be necessary to invalidate the command table when it changes. It's probably not worth being clever about this: just invalidate the cache on every change. Adds 40-80 bytes (GitHub issue #329)
* | win32: change interpretation of BB_OVERRIDE_APPLETSRon Yorston2023-06-022-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the following changes to BB_OVERRIDE_APPLETS: - Applet names in the list can be separated by spaces, commas or semicolons. - Applets before the first semicolon are disabled unconditionally. - Applets after the first semicolon are overridden if a matching external command exists. - '-' alone disables all applets. - '+' alone overrides every applet for which a matching external command exists. This doesn't change the existing documented behaviour. It adds the ability to have applets overridden if an external command exists but to remain available if not. Adds 80-88 bytes. (GitHub issue #329)
* | win32: fix euro symbol handlingRon Yorston2023-06-022-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Commit 2b4dbe5fa (libbb: speed up bb_get_chunk_from_file()) speeded up grep by a factor of two. However, it introduced a call to OemToCharBuff() in bb_get_chunk_from_file() which didn't have the fix for the euro symbol from commit 93a63809f9 (win32: add support for the euro currency symbol). Export the fixed version of OemToCharBuff() and use it. Saves 8 bytes (64-bit), adds 28 bytes (32-bit)
* | win32: skip test for non-console apps if necessaryRon Yorston2023-06-021-0/+4
| | | | | | | | | | | | | | | | | | Commit 20b6a57af (win32: crtl-c interrupts non-console applications) introduced a test for non-console apps in the Ctrl-C handler. Skip this if GetConsoleProcessList() isn't available. Costs 68-88 bytes.
* | Update READMERon Yorston2023-06-021-4/+5
| |
* | ls: allow hidden system files to be omittedRon Yorston2023-06-011-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'ls' applet in busybox-w32 treated files with the hidden attribute as though they had a leading '.'. Some such files also have the system attribute set. Since these aren't of much interest to most users and since several of them have long unsightly names there's some advantage in allowing them to be omitted from the listing. Implement this by omitting hidden system files if the '-a' or '-A' option is given twice. Adds 80-88 bytes (GitHub issue #328)
* | ash: enable 'set -/+o noconsole'Ron Yorston2023-06-013-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the 'noconsole' shell option could only be set as a shell command line option. Allow it to be changed from within the shell by 'set -o noconsole' or 'set +o noconsole'. The console window is now minimised rather than hidden. This makes it easier for the user to access the console when 'noconsole' is in effect. Adds 8-32 bytes. (GitHub issue #325)
* | su: fix usage messageFRP-5007-g82accfc19Ron Yorston2023-05-281-1/+1
| |
* | win32: support "app exec link" reparse pointsRon Yorston2023-05-273-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reparse points with the tag IO_REPARSE_TAG_APPEXECLINK are present in ~/AppData/Local/Microsoft/WindowsApps in Windows 10 and 11. They are: Used by Universal Windows Platform (UWP) packages to encode information that allows the application to be launched by CreateProcess. Modify readlink(2) and lsattr(1) to treat them as symbolic links, in much the same way as was done previously for junctions. They aren't really symbolic links but they're similar. Costs 128-160 bytes. (GitHub issue #327)
* | Merge branch 'busybox' into mergeRon Yorston2023-05-2312-53/+561
|\|
| * ash: use-after-free in bash pattern substitutionKarsten Sperling2023-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | Commit daa66ed6 fixed a number of use-after-free bugs in bash pattern substitution, however one "unguarded" STPUTC remained, which is fixed here. function old new delta subevalvar 1564 1576 +12 Signed-off-by: Karsten Sperling <ksperling@apple.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * examples/var_service/README: fix an errorDenys Vlasenko2023-05-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cpio: tweak --helpDenys Vlasenko2023-05-091-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nslookup: code shrinkDenys Vlasenko2023-05-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | function old new delta send_queries 725 723 -2 nslookup_main 822 820 -2 add_query 89 86 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-7) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nslookup: ensure unique transaction IDs for the DNS queriesDenys Vlasenko2023-05-091-4/+390
| | | | | | | | | | | | | | | | | | | | | | | | Based on patch by Uwe Kleine-König. It makes sense to actually see the nitty-gritty details of DNS querying, so bringing in (commented-out) musl's DNS request code. function old new delta nslookup_main 760 822 +62 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: add comment about abort on syntax error %{^}Denys Vlasenko2023-05-091-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: fix "Config.in:117 error: Overlong line"Denys Vlasenko2023-05-081-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix an interactive abort on errorDenys Vlasenko2023-05-081-0/+8
| | | | | | | | | | | | | | function old new delta parse_and_run_stream 140 155 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: Make it possible to build with 64bit time_tUwe Kleine-König2023-05-072-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On most 32bit architectures time_t (and a few other time related types) are a signed 32bit wide integer type. As a consequence they can only represent dates between Fri Dec 13 08:45:52 PM UTC 1901 (-0x80000000 seconds before Jan 1 1970) and Tue Jan 19 03:14:07 AM UTC 2038 (0x7fffffff seconds after Jan 1 1970). Given that some machines that are built today have an expected lifetime of >15 years, this needs to be extended. To to that, define the cpp symbol _TIME_BITS to 64 which results in some magic in glibc to make time_t (and the few other time related types) 64 bit wide. This new switch CONFIG_TIME64 is in the spirit of CONFIG_LFS and only expected to have the expected effect with glibc. On musl for examples time_t already defaults to 64bit wide types. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * readlink: code shrinkDenys Vlasenko2023-05-071-5/+4
| | | | | | | | | | | | | | function old new delta readlink_main 111 103 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nmeter: improve %T fractionals displayDenys Vlasenko2023-05-071-0/+18
| | | | | | | | | | | | | | function old new delta nmeter_main 751 786 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * factor: we can pack 21, not 20, 3-bit elements into packed wheel wordsDenys Vlasenko2023-04-231-36/+35
| | | | | | | | | | | | | | | | | | | | function old new delta packed_wheel 192 184 -8 factor_main 171 163 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-16) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip: code shrinkDenys Vlasenko2023-04-232-5/+82
| | | | | | | | | | | | | | function old new delta ipaddr_list_or_flush 1089 1079 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | drop: changes to ctrl-c handlingRon Yorston2023-05-231-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new kill_child_ctrl_handler() function: - Ctrl-C can be used to terminate non-console applications. - Ctrl-C in an interactive cmd.exe or PowerShell session won't cause drop to terminate. Also: - Use getopt32() to process options. - Update usage messages. Adds 96-160 bytes.
* | win32: crtl-c interrupts non-console applicationsRon Yorston2023-05-232-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9db9b34ad (win32: ignore ctrl-c in parent of execve(2)) prevented a parent process from reacting to Ctrl-C while it was waiting for its child to complete. This avoids the problem where a shell and an interactive child end up competing for input after a Ctrl-C. However, a child process which isn't attached to the console (a GUI application, for example) can't then be killed by Ctrl-C. Instead of completely ignoring Ctrl-C give the parent a handler which detects if its child is attached to the console. If so it's left to handle Ctrl-C itself and the parent ignores the interrupt. If not the parent terminates the child and all its children as if by SIGINT. Costs 200 bytes.
* | win32: changes to signal handlingRon Yorston2023-05-235-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use an exit code of the form (signal << 24) when a process exits due to a signal. This replaces the previous use of (signal + 128). This makes it easier to distinguish exit codes from signals. Allow kill(2) to handle all defined signals, not just EXIT, TERM and KILL. The kill and timeout applets now accept any defined signals. Convert certain Windows status codes Unix-style signal codes. In ash: - Exit as if with SIGINT in raise_interrupt() rather than call raise(SIGINT). The latter returns an exit code of 3. - Detect if a child process exits as if with SIGINT. If not and if the parent is an interactive top-level shell, reset pending_int. This prevents the parent from seeing an INT if the child hasn't reported it exited due to INT. (Probably due to it being an interactive shell.) Costs 132-136 bytes.
* | timeout: code shrinkRon Yorston2023-05-231-2/+6
| | | | | | | | | | | | | | | | | | In the win32 code the 'parent' variable is always zero. It's also used as the pid to be killed when the child process survives the initial kill attempt. Although this works as intended there's no need for the 'parent' variable. Saves 16 bytes.
* | su: add option to keep console open on shell exitRon Yorston2023-05-022-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The '-N' option keeps the console window open after the elevated shell exits. Previously this was achieved by passing the '-s' option along with '-c'. Recent changes allow scripts to be run without using '-c' so a new mechanism is required. su passes the '-N' flag to the shell. This causes the shell to issue a prompt and wait for user input when it exits. Costs 200-204 bytes.
* | su: add option to wait for shell exit codeRon Yorston2023-05-021-3/+27
| | | | | | | | | | | | | | The '-W' option causes su to wait for the elevated shell to terminate and returns its exit code. Costs 144 bytes.
* | make: special treatment of archive membersRon Yorston2023-05-011-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard says: If a target or prerequisite contains parentheses, it shall be treated as a member of an archive library. For the lib(member.o) expression lib refers to the name of the archive library and member.o to the member name. 'lib(member.o)' is referred to as an 'expression' rather than a name; 'lib' and 'member.o' are called names. Allow for this in is_valid_name() by splitting such expressions into separate archive/member names and checking these individually.
* | win32: further code shrink quote_args()Ron Yorston2023-04-281-19/+3
| | | | | | | | | | | | | | | | Squeeze a few more bytes out of quote_args(). (Thanks to GitHub user avih.) Saves 16 bytes.