aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * df: do "rootfs" check soonerDenys Vlasenko2018-02-231-4/+5
| | | | | | | | | | | | | | function old new delta df_main 1065 1064 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * df: 4TB+ support on 32 bits archDenys Vlasenko2018-02-231-8/+15
| | | | | | | | | | | | | | | | | | Reported for Pascal Bellard. function old new delta df_main 1054 1065 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Fix install with hardlinks and a custom PREFIX. Closes 10801Denys Vlasenko2018-02-231-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Trying to install busybox with hardlinks and a custom PREFIX will fail for applets not in the /bin directory, because relative pathnames are used. applets/install.sh is *supposed to* use the absolute pathname for hardlinks but it fails to do so because the wrong check is used in the if statement. While fixing it, shore up other sloppy coding in applets/install.sh Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: move address_fmt[] from data to globals. 8 less bytes in data sectionDenys Vlasenko2018-02-221-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta od_main 2164 2179 +15 address_fmt 8 - -8 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 15/-8) Total: 7 bytes text data bss dec hex filename 930954 481 6852 938287 e512f busybox_old 930977 473 6852 938302 e513e busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix potentially buggy use of OPT_STRDenys Vlasenko2018-02-221-12/+15
| | | | | | | | | | | | | | | | | | | | | | This also makes OPT_STR reused: text data bss dec hex filename 930979 481 6852 938312 e5148 busybox_old 930954 481 6852 938287 e512f busybox_unstripped ^^^^^^ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: in -s handling, return 1/-1, not 1/0 compare resultDenys Vlasenko2018-02-221-2/+3
| | | | | | | | | | | | | | function old new delta compare_keys 794 795 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: compile capability code only if FEATURE_SETPRIV_CAPABILITIES or RUN_INITDenys Vlasenko2018-02-213-4/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix -s. Closes 10671Denys Vlasenko2018-02-211-12/+57
| | | | | | | | | | | | | | | | | | | | function old new delta sort_main 786 862 +76 compare_keys 720 794 +74 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 150/0) Total: 150 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * iplink: implement support for selecting a master interfaceJan Luebbe2018-02-203-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attaching an interface to a VRF is done by setting the interface's master. Besides VRF, this can also be used for bridges. function old new delta set_master - 142 +142 do_iplink 1262 1357 +95 packed_usage 32546 32539 -7 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 237/-7) Total: 230 bytes Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip link: support "add TYPE vrf", improve --helpJan Luebbe2018-02-202-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | VRF interfaces have a mandatory table parameter, which needs to be specified using a RTNL attribute. function old new delta do_add_or_delete 1150 1254 +104 packed_usage 32444 32546 +102 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 206/0) Total: 206 bytes Signed-off-by: Jan Luebbe <jluebbe@debian.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * umount: fix "umount -t FSTYPE MNTPOINT" acting as if -a is specifiedDenys Vlasenko2018-02-201-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | While at it, add -t to --help, and fix comments which say that -t is ignored function old new delta packed_usage 32427 32444 +17 umount_main 558 552 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 17/-6) Total: 11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar,unzip: postpone creation of symlinks with "suspicious" targetsDenys Vlasenko2018-02-206-79/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly reverts commit bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 "libarchive: do not extract unsafe symlinks unless $EXTRACT_UNSAFE_SYMLINKS=1" Users report that it is somewhat too restrictive. See https://bugs.busybox.net/show_bug.cgi?id=8411 In particular, this interferes with unpacking of busybox-based filesystems with links like "sbin/applet" -> "../bin/busybox". The change is made smaller by deleting ARCHIVE_EXTRACT_QUIET flag - it is unused since 2010, and removing conditionals on it allows commonalizing some error message codes. function old new delta create_or_remember_symlink - 94 +94 create_symlinks_from_list - 64 +64 tar_main 1002 1006 +4 unzip_main 2732 2724 -8 data_extract_all 984 891 -93 unsafe_symlink_target 147 - -147 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/2 up/down: 162/-248) Total: -86 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * poweroff: add a config option for people needing VERY early poweroffDenys Vlasenko2018-02-191-0/+54
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * mkfs_ext2, mkfs_vfat: fix warnings in STORE_LE on big-endian platformsDenys Vlasenko2018-02-152-6/+6
| | | | | | | | | | | | "warning: large integer implicitly truncated to unsigned type [-Woverflow]" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: remove redundant floor preventionDenys Vlasenko2018-02-141-2/+0
| | | | | | | | | | | | | | function old new delta tls_xread_record 499 489 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ping: don't call monotonic_us twice per sending the pingDenys Vlasenko2018-02-131-10/+11
| | | | | | | | | | | | | | | | | | | | | | function old new delta sendping6 80 85 +5 sendping4 106 111 +5 sendping_tail 209 204 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 10/-5) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ping: implement -A "adaptive ping"Denys Vlasenko2018-02-131-40/+60
| | | | | | | | | | | | | | | | | | | | | | function old new delta common_ping_main 1757 1862 +105 packed_usage 32367 32427 +60 sendping_tail 236 209 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 165/-27) Total: 138 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * inetd,mount: add comment with example of flags to build with libtirpcDenys Vlasenko2018-02-132-2/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * progress meter: add disabled code for a more stable ETADenys Vlasenko2018-02-132-0/+14
| | | | | | | | | | | | Compiles to ~25 bytes if enabled. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: simplify process_command_subs()Denys Vlasenko2018-02-131-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incidentally, this fixes LINENO bug here: echo "1:${LINENO}" echo "2:`echo; echo`" # was counting lines in the `cmd` output as LINENO++ echo "3:${LINENO}" function old new delta parse_and_run_file 53 71 +18 expand_vars_to_list 1187 1164 -23 setup_file_in_str 25 - -25 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 18/-48) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash : fix double-quoted "\z" handlingDenys Vlasenko2018-02-135-6/+113
| | | | | | | | | | | | | | function old new delta readtoken1 2602 2608 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Remove fake signal-handling codeRon Yorston2018-03-018-32/+39
| | | | | | | | | | | | | | | | | | Microsoft Windows has only limited support for signals. busybox-w32 initially papered over this fact by adding definitions for unsupported signals and signal-handling functions. Remove this fake code and deal with the consequences by excluding anything that fails to compile as a result.
* | lineedit: disable window size tracking in default configurationRon Yorston2018-03-014-4/+23
| | | | | | | | | | SIGWINCH isn't available on Microsoft Windows. Make the use of SIGWINCH configurable and disable it by default.
* | win32: make has_exec_format staticRon Yorston2018-03-012-56/+55
| | | | | | | | The only other caller (in spawnveq) has been removed.
* | win32: additional improvements to handling of executablesRon Yorston2018-02-283-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Consistent processing of file extensions, as described in the previous commit, has been applied to the 'which' applet and the functions find_executable and mingw_spawn_interpreter. In spawnveq check that the file to be executed exists and is executable, and ensure that it won't have any extensions added by spawnve. It's intended that all files passed to spawnve should have their names fully specified. If this isn't the case the tests here will cause errors which will need to be fixed.
* | ash: changes to command resolution, execution and displayRon Yorston2018-02-281-23/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ash separates searching for commands from running them. Searching is performed in find_command(). The result of the search is stored in a hash table but not as the full path: the path is reconstructed in shellexec() by combining the directory and command name. In Windows the command name is insufficient, as the executable name may also include an extension. To resolve this we must ensure that extensions are processed in the same order in find_command, shellexec and any other places where command names are resolved into file names. The order used matches that of spawnve: .com, .exe, .bat, .cmd. Finally the bare filename with no additional extension The order has been made consistent: - in find_command for absolute paths and the Windows-specific path search; - in tryexec (which is called by shellexec) where an additional test that the file is executable has been added; - in the type and hash built-ins where the output has been modified to include the extension. Additionally, the code in tryexec to handle ENOEXEC errors from execve has been excluded. The rationale for the exec functions in POSIX [1] suggests the requirement to retry is a workaround for the lack of '#!' support on some platforms. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html
* | win32: don't add extensions to filenames ending with a dotRon Yorston2018-02-282-2/+9
| | | | | | | | | | | | | | A filename ending with a dot is a signal to spawnve not to try adding extensions but to use the name unmodified. The add_win32_extension function should follow the same rule.
* | win32: fix code to check for file extensionsRon Yorston2018-02-271-1/+1
| | | | | | | | | | The has_win_suffix function didn't check that the extension started with a '.'. As a result the shell was unable to execute cmd.exe.
* | libbb: ensure build details are only stored onceRon Yorston2018-02-261-1/+1
| | | | | | | | | | Determine the size of the MINGW_VER string at compile time so it's only stored once.
* | win32: move detection of file formats to stat(2)Ron Yorston2018-02-267-77/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the code to detect shell scripts and binary executables from mingw_access to a separate function, has_exec_format. Call this function in do_lstat to decide whether to set the executable bits in the file mode. This will slow down stat but has a couple of advantages: - shell scripts are highlighted in ls output - the test applet can use stat(2) to detect executable files The new function is used to handle another corner case in spawnveq: binary executables without the usual .exe extension are only run by spawnve if the file name ends with '.'. Two minor changes: - file_is_win32_executable has been renamed add_win32_extension to clarify what it does - a call to file_is_executable has been removed from find_command in ash as it resulted in unhelpful error messages.
* | win32: improvements to stat(2) emulationRon Yorston2018-02-261-25/+18
| | | | | | | | | | | | | | Set all mode bits rather than just setting user modes and then extending them to group and other. Combine common code in mingw_fstat.
* | tar: don't save file statusRon Yorston2018-02-261-0/+4
| | | | | | | | | | Since we're unable to track the file using its device/inode there's no need to obtain the file's status.
* | win32: add support for batch filesRon Yorston2018-02-264-30/+82
| | | | | | | | | | | | | | | | Support batch files with .bat and .cmd extensions, similar to what's done for .exe and .com. Check extensions in the same order as Windows' spawn function: .com, .exe, .bat, .cmd.
* | win32: make /dev/urandom more randomRon Yorston2018-02-234-2/+244
| |
* | ash: tidy up /dev/null redirectionRon Yorston2018-02-221-11/+6
| | | | | | | | | | Remove some duplicated code and raise an error for unsupported devices.
* | shred: fix up for WIN32 and enable by defaultRon Yorston2018-02-223-2/+8
| | | | | | | | | | | | | | | | Use the new low-level support for /dev/zero and /dev/urandom to allow shred to work in busybox-w32. The only change required is to close the file before unlinking it, as Microsoft Windows won't delete an open file.
* | dd: use new device handling to implement /dev/zero and /dev/urandomRon Yorston2018-02-221-13/+10
| | | | | | | | | | | | Replace internal support for /dev/zero with the newly introduced device handling in open/read. This reduces the differences between busybox-w32 and upstream.
* | win32: handle /dev/zero and /dev/urandom in open and read functionsRon Yorston2018-02-223-3/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently /dev/zero is handled as a special case in dd. Add hacks to the open and read functions in mingw.c to handle the zero and urandom devices. - Opening /dev/zero or /dev/urandom actually opens the special Windows file 'nul' which behaves like /dev/null. This allows manipulation of the file descriptor with things like seek and close - When /dev/zero or /dev/urandom is opened the resulting file descriptor is stored and used to override the behaviour of read. - No attempt is made to track duplicated file descriptors, so using these devices for redirections in the shell isn't going to work and won't be permitted. (Could be, but won't.) - Limited control of the special file descriptors is provided by allowing the internal variables to be changed. - The numbers from /dev/urandom aren't very random.
* | fsync: enable in default configurationRon Yorston2018-02-223-2/+5
| |
* | win32: tailor inet_pton.c for use in busybox-w32Ron Yorston2018-02-221-11/+8
| |
* | win32: import inet_pton.c from ISC BINDRon Yorston2018-02-221-231/+182
| | | | | | | | | | | | | | | | The copy of inet_pton.c imported from gnulib was licensed under GPL3 which is incompatible with the GPL2-only licence of BusyBox. Import an MPL2-licensed version of this file from ISC BIND git master as of this date.
* | win32: import fsync(2) implementation from gnulibRon Yorston2018-02-214-1/+78
| |
* | ash: use correct size for tblentryRon Yorston2018-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | As noted in cmdlookup the size of a tblentry instance, *t, is sizeof(struct tblentry) + strlen(t->cmdname) because the structure includes one byte for the cmdname array. Apply the same logic in tblentry_size and tblentry_copy.
* | win32: use built-in shell for popen, if possibleRon Yorston2018-02-181-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | popen uses the shell to run the command provided. If BusyBox has been configured appropriately use the built-in shell for this. - Currently the only user of popen in busybox-w32 is awk, which uses it when piping to or from commands. - If the command is available as an applet the shell will use it. If a different version of the program is required the command will need to specify the full path. - This change means that popen will work even if no shell is present on the path. - Since the binary may have been run as sh.exe or awk.exe it's necessary to use the magic --busybox option.
* | ash: allow waitpid_child to blockRon Yorston2018-02-171-1/+1
| | | | | | | | | | The wrong sort of boolean operator resulted in waitpid_child always being nonblocking.
* | win32: add dummy sys/select.h required for pollRon Yorston2018-02-141-0/+0
| |
* | win32: update poll implementation to match latest gnulib versionRon Yorston2018-02-131-209/+207
| |
* | du: use Windows-compatible print formatsRon Yorston2018-02-132-4/+4
| | | | | | | | | | | | | | | | Commit 18afed0f9 replaced %ll* formats with Windows equivalents to silence compiler warnings. Some format strings in du were missed because they weren't compiled or weren't string literals. These fixes make 'du -h' work as expected on Windows XP.
* | win32: always use safe API calls to manipulate environmentRon Yorston2018-02-135-118/+26
| | | | | | | | | | | | | | | | | | | | | | It turns out that with the new toolchain safe API calls work on all all platforms. Even the original code from commit fa147bd7e works on Windows XP when built with the new tools. - Remove the unsafe environment manipulation via the environ array - Microsoft's putenv takes a copy of its argument so the string can be freed - Rewrite some routines and add more error checking
* | which: treat busybox as a special caseRon Yorston2018-02-131-1/+8
| | | | | | | | | | | | | | Busybox knows the path to its own executable even if it isn't on PATH. Treat this as a special case and print the path. `which busybox` is used in testsuite/busybox.tests