summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * shell: Fix "read -d ''" behaviorChristian Eggers2020-07-315-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With bash's read builtin it is possible to read from a file (e.g. device-tree) until the first '\0' character: IFS= read -r -d '' VARIABLE < file In busybox ash the -d extension is also implemented, but checking the read character for '\0' has to be performed after comparing with the delimiter. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * httpd_indexcgi.c: use CSS for odd/even rowsSergey Ponomarev2020-07-311-8/+2
| | | | | | | | | | Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * httpd_indexcgi.c: minimize style CSSSergey Ponomarev2020-07-311-37/+37
| | | | | | | | | | | | | | Remove new lines \n and some semicolons ;. This minimize page style size from 655 to 604 Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lsscsi: code shrinkDenys Vlasenko2020-07-201-15/+12
| | | | | | | | | | | | | | | | | | | | function old new delta lsscsi_main 298 302 +4 get_line 56 45 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-11) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: fix refid reported in server mode, closes 13056Denys Vlasenko2020-07-204-7/+41
| | | | | | | | | | | | | | | | | | | | function old new delta resolve_peer_hostname 129 196 +67 recv_and_process_peer_pkt 2475 2476 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 68/0) Total: 68 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * networking: support ftp PASV responses not ending with ')'Denys Vlasenko2020-07-191-0/+2
| | | | | | | | | | | | | | | | | | Patch by Baruch Burstein <bmburstein@gmail.com> function old new delta parse_pasv_epsv 153 181 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: shrink last_char_is(), no longer allow NULL string argumentDenys Vlasenko2020-07-191-10/+5
| | | | | | | | | | | | | | function old new delta last_char_is 40 28 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * domain_codec: optimize dname_dec and convert_dnameMartin Lewis2020-07-121-78/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dname_dec: now iterates over the packet only once. convert_dname: remove redundant checks and code shrink. While testing I've noticed that some of the tests didn't compile properly, so I fixed them. function old new delta dname_dec 286 267 -19 dname_enc 166 143 -23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-42) Total: -42 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * crontab: Fix -e with editors saving using renaming strategyGray Wolf2020-07-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some editors (like vim) use renaming strategy to save file. That means they save a file to some random name and then rename it to final location. The advantage is that such save is atomic. However, crontab -e holds open fd to the temporary file, meaning it never sees the changes. The temporary file needs to be re-opened after the editor terminates for the changes to properly save. Fixes #12491 Signed-off-by: Gray Wolf <wolf@wolfsden.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: code shrink Unix-style path handlingRon Yorston2020-08-237-96/+50
| | | | | | | | | | | | | | | | Replace auto_add_system_drive() with alloc_system_drive() which leaves space for a possible filename extension. This makes it possible to drop alloc_win32_extension() and auto_win32_extension(). Saves 144 bytes.
* | ash: use stack, not heap, to add system drive to pathRon Yorston2020-08-211-16/+27
| | | | | | | | Make the code a bit tidier, no change to functionality or size.
* | win32: allow putenv() to set empty valuesRon Yorston2020-08-211-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WIN32 _putenv() can't set an environment variable with an empty value because 'NAME=' is treated as a request to delete the variable. Allow mingw_putenv() to set an empty value by first setting a fake value and then truncating it. This problem has always been present in mingw_putenv() but it became particularly pressing when ash started treating all applets as NOEXEC. The environment of NOEXEC applets is created by clearing the current environment and using putenv() to set a new one from the shell variables. Empty variable were not being set. See GitHub issue #197.
* | win32: env.c code shrink and clarificationRon Yorston2020-08-211-7/+6
| | | | | | | | | | | | | | | | Use xasprintf() to create string in unsetenv(). Clarify when we're using WIN32 _putenv(). No change in functionality; saves 16 bytes.
* | ls: allow backslashes to be replaced in displayed pathsfix_backslashRon Yorston2020-08-191-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally 'ls' displays paths exactly as the user enters them: $ ls .//file .//file In busybox-w32 paths using backslash as a separator are displayed in a form that can't be reused as input to the shell: $ ls .\\file .\file Allow backslashes to be replaced with forward slashes if the environment variable BB_FIX_BACKSLASH is set to 1. See GitHub issue #196.
* | busybox: create custom installation directoryRon Yorston2020-08-151-5/+6
| | | | | | | | | | If a custom installation directory is specified try to create it. Don't worry if we can't, we'll find out when the links fail.
* | busybox: add option to install to Unix-style pathsRon Yorston2020-08-142-12/+35
| | | | | | | | | | The command 'busybox --install -u' installs links to Unix-style paths in the system drive.
* | win32: use built-in applets for non-existent binaries with Unix-style pathsRon Yorston2020-08-135-11/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell scripts moved from Unix may contain hard-coded paths to binaries such as /bin/sh. A recent commit made it possible to execute such binaries reliably, but that does require them to be installed. As an alternative solution: if a binary with a standard Unix path prefix can't be found but is available as a built-in applet, run the applet. Add the function unix_path() to detect paths starting with /bin, /usr/bin, /sbin or /usr/sbin. Use this function in: - the 'which' applet - shellexec(), describe_command() and find_command() in ash - mingw_spawn_1() See GitHub issue #195.
* | httpd: code shrinkRon Yorston2020-08-131-3/+2
| | | | | | | | Use the new need_system_drive() function in httpd. Saves 16 bytes.
* | win32: handle Unix-style absolute paths for executablesRon Yorston2020-08-137-4/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As noted in commit 548ec7045 (win32: interpret absolute paths as relative to %SYSTEMDRIVE%) a path starting with a '/' in the Unix world is treated as relative to the current drive by Windows. To avoid ambiguity that commit considered certain such paths to be relative to %SYSTEMDRIVE%. Extend this to paths representing executables. Add the functions need_system_drive() and auto_add_system_drive() to detect the need for a system drive prefix and to add it if necessary. Use these functions in: - the 'which' applet - the find_executable() function - tab-completion code - PATH look-up, shellexec(), describe_command() and find_command() in ash - parse_interpreter() and mingw_spawn_1() With these changes executable paths starting with a slash are handled consistently, whatever the current drive.
* | win32: use a static buffer in get_system_drive()Ron Yorston2020-08-134-18/+16
| | | | | | | | | | | | | | Allocate static storage for the system drive string instead of making a new allocation on every call. This is easier to manage. Adds 16 bytes.
* | win32: code shrinkRon Yorston2020-08-135-7/+17
| | | | | | | | | | | | | | | | | | | | Add a new function, has_path(), to detect that an executable name doesn't require a path look-up. Also, since is_absolute_path() is now only used in shell/ash.c move its definition there from include/mingw.h. Saves 128 bytes.
* | which: handle paths of form 'c:path'Ron Yorston2020-08-131-2/+5
| | | | | | | | | | | | | | Add another case where paths of the form 'c:path' need special treatment. Adds 16 bytes.
* | win32: move code to fork (de)compressor to a functionRon Yorston2020-08-054-38/+29
| | | | | | | | | | | | | | | | Use a new common function, mingw_fork_compressor(), to implement fork_transformer() in open_transformer.c and vfork_compressor() in tar.c. Saves 160 bytes.
* | which: rearrange conditional compilationRon Yorston2020-08-041-1/+6
| | | | | | | | The code for standalone shell mode should only be built for WIN32.
* | win32: update strptime(3) implementationRon Yorston2020-08-031-12/+19
| | | | | | | | | | | | | | | | | | | | Update to latest code from gnulib. This adds a '%q' (quarter) field descriptor. Remove the 'neg' variable from the code to handle the '%z' (timezone) field descriptor. Since our struct tm lacks a tm_gmtoff member '%z' is only supported "for reasons of symmetry". Since the computed value is never used there's no need to negate it.
* | build system: reinstate PLATFORM_LINUXRon Yorston2020-08-032-0/+2
| | | | | | | | | | | | | | Removing 'select PLATFORM_LINUX' from ps and stat has no material effect: it just causes match_fstype.o to be built needlessly. Remove this difference from upstream.
* | install: enable in default buildRon Yorston2020-08-032-10/+14
| | | | | | | | | | Attempting to set file ownership and permissions may not work exactly as on *NIX.
* | win32: code shrink kill(2)Ron Yorston2020-07-253-33/+19
| | | | | | | | | | | | | | | | - Drop exit_code argument from kill_SIGTERM_by_handle() - Pass signal number rather than exit code to other functions - Merge kill_SIGKILL() and kill_SIGTEST() Saves 112 bytes.
* | win32: update link to Microsoft document on command-line argumentsRon Yorston2020-07-211-1/+1
| |
* | ts: correct output in 64-bit buildRon Yorston2020-07-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | ts failed to output the correct time when built for 64-bit Windows. In 64-bit builds time_t is a 64-bit quantity whereas the tv_sec member of struct timeval is 32-bit. https://sourceforge.net/p/mingw-w64/bugs/783/ Use a temporary time_t value in 64-bit builds.
* | win32: alter build flagsFRP-3532-g01a256149Ron Yorston2020-07-091-1/+1
| | | | | | | | | | Add -fno-builtin-strndup to the build flags, otherwise builds with link-time optimisation can't find strndup.
* | win32: import strndup from gnulibRon Yorston2020-07-093-0/+42
| |
* | Merge branch 'busybox' into mergeRon Yorston2020-07-0946-390/+584
|\|
| * libbb: code shrink in last_char_is()Denys Vlasenko2020-06-301-8/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * compare_string_array: code shrinkMartin Lewis2020-06-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code shrink and prevention of possible out of bounds access. function old new delta nth_string 36 26 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10) Total: -10 bytes text data bss dec hex filename 981342 16915 1872 1000129 f42c1 busybox_old 981332 16915 1872 1000119 f42b7 busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * procps: code shrinkMartin Lewis2020-06-291-2/+10
| | | | | | | | | | | | | | | | | | | | | | function old new delta skip_whitespace_if_prefixed_with - 17 +17 procps_read_smaps 911 854 -57 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 17/-57) Total: -40 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc: fix a TODO in fill_envp using option scannerMartin Lewis2020-06-291-114/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fill_envp now iterates over the packet only once instead of a few hundred times using the new option scanner. function old new delta udhcp_scan_options - 189 +189 putenvp - 46 +46 init_scan_state - 22 +22 udhcp_get_option 227 104 -123 udhcp_run_script 835 601 -234 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/2 up/down: 257/-357) Total: -100 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcp: add option scannerMartin Lewis2020-06-292-42/+62
| | | | | | | | | | | | | | Added an option scanner to udhcp to enable iteration over packet options. Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: fix openssl options for cert verificationScott Court2020-06-291-4/+17
| | | | | | | | | | | | | | | | | | | | | | function old new delta is_ip_address - 54 +54 spawn_https_helper_openssl 461 486 +25 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 79/0) Total: 79 bytes Signed-off-by: Scott Court <z5t1@z5t1.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * acpid: only display -p if supported in usageNorbert Lange2020-06-292-2/+4
| | | | | | | | | | Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dhcpd: remove hardcoded pidfile pathNorbert Lange2020-06-291-1/+7
| | | | | | | | | | Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dpkg: prevent important directories from being removedNorbert Lange2020-06-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | busybox will remove directory symlinks, which is at odds with common layouts that have some of bin/lib/lib32/lib64 symlinked. this adds a exludelist for critcal and often symlinked directories. Fixes: Bug 12551 function old new delta remove_file_array 139 231 +92 Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nc_bloaty: support udp broadcast portsNorbert Lange2020-06-291-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a -b option, identical to debians "traditional" netcat. This allows sending (subnet) UDP Broadcasts. function old new delta packed_usage 33420 33441 +21 nc_main 1041 1057 +16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Start 1.33.0 development cycleDenys Vlasenko2020-06-261-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Bump version to 1.32.01_32_0Denys Vlasenko2020-06-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * gzip -d with zcat enabled but gunzip disabled was misbehavingDenys Vlasenko2020-06-251-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * make_single_applets.sh: switch off nologin deps optionDenys Vlasenko2020-06-241-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: placate a "defined but not used" warningDenys Vlasenko2020-06-241-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nologin: make it possible to build it as single appletDenys Vlasenko2020-06-245-64/+110
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * suppress a few compile warningsDenys Vlasenko2020-06-242-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>