aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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
* | Merge branch 'busybox' into mergeRon Yorston2018-02-13146-2127/+2827
|\|
| * wget: more thorough sanitization of other side's dataDenys Vlasenko2018-02-121-31/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_sanitized_hdr - 156 +156 fgets_trim_sanitize - 128 +128 ftpcmd 129 133 +4 parse_url 461 454 -7 sanitize_string 14 - -14 wget_main 2431 2381 -50 fgets_and_trim 119 - -119 gethdr 163 - -163 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 1/2 up/down: 288/-353) Total: -65 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * testsuite: update busybox and bzcat testsRon Yorston2018-02-122-14/+12
| | | | | | | | | | | | | | | | | | | | | | Test scripts that use CONFIG_* variables need to source .config. Since this wasn't being done for busybox many tests were skipped. As a result new failures due to changes in help output were missed. Also remove some unnecessary echos in the bzcat script. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cp: fix option handling in non-longopt configDenys Vlasenko2018-02-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | the patch getopt32: remove opt_complementary 22542eca18e5807b72ddc78999f5101e33f17a53 introduced a regressed in the cp command since it removed all aliases of arguments if long_opts is not configured. Patch by Sebastian Gottschall <s.gottschall@dd-wrt.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: code shrinkDenys Vlasenko2018-02-111-19/+20
| | | | | | | | | | | | | | | | function old new delta catcher 310 309 -1 arping_main 1668 1641 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: introduce and use bb_getsockname()Denys Vlasenko2018-02-116-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta bb_getsockname - 18 +18 xrtnl_open 88 83 -5 do_iplink 1216 1209 -7 arping_main 1686 1668 -18 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/3 up/down: 18/-30) Total: -12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: move packet buffer, sigset and struct ifreq to malloced "globals"Denys Vlasenko2018-02-111-41/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This way, we can zero them all in one go. We do malloc() anyway, thus nothing is lost by mallocing "globals" function old new delta arping_main 1683 1686 +3 finish 100 86 -14 catcher 350 310 -40 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 3/-54) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: fix the case when inherited signal mask masks out ALRMDenys Vlasenko2018-02-111-7/+16
| | | | | | | | | | | | | | function old new delta arping_main 1629 1635 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: change a few message strings to be closer to iputils arpingDenys Vlasenko2018-02-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARPING 192.168.1.1 from 192.168.1.172 wlan0 Unicast reply from 192.168.1.1 [F4:F2:6D:52:A8:DE] 1.672ms Sent 1 probes (1 broadcast(s)) Received 1 response(s) ARPING 192.168.1.1 from 192.168.1.172 wlan0 Unicast reply from 192.168.1.1 [f4:f2:6d:52:a8:de] 1.152ms Sent 1 probe(s) (1 broadcast(s)) Received 1 response(s) (0 request(s), 0 broadcast(s)) function old new delta finish 120 100 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: code shrinkDenys Vlasenko2018-02-111-28/+28
| | | | | | | | | | | | | | | | | | | | Do not clear extra bits on option_mask32, it's not necessary. Move DAD bit to 2, this makes exit logic simpler. function old new delta arping_main 1655 1629 -26 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * svlogd: improve --help textDenys Vlasenko2018-02-091-6/+13
| | | | | | | | | | | | | | function old new delta packed_usage 32278 32367 +89 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: probably fixing a bug in last LINENO fixDenys Vlasenko2018-02-081-11/+6
| | | | | | | | | | | | | | | | | | | | I don't have an example of mishandled script, but the logic looked wrong: it could sometimes treat newlines as if they are spaces. function old new delta parse_stream 2788 2787 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: LINENO fixDenys Vlasenko2018-02-081-24/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Script triggering the bug: t=0 echo "at line ${LINENO}" while [ ${t} -lt 10 ]; do echo "at line ${LINENO}" # LINENO was 3 instead of 4 here t=$((t+1)) done function old new delta parse_stream 2754 2788 +34 done_word 711 738 +27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0) Total: 61 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip: fix crash in "ip neigh show"Denys Vlasenko2018-02-087-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parse_rtattr() was using tb[] array without initializing it. Based on patch by Balaji Punnuru <balaji_punnuru@cable.comcast.com> function old new delta parse_rtattr 85 107 +22 print_route 1630 1617 -13 print_linkinfo 807 794 -13 iproute_get 835 822 -13 print_rule 680 665 -15 ll_remember_index 263 248 -15 print_addrinfo 1223 1197 -26 ipaddr_list_or_flush 1253 1223 -30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/7 up/down: 22/-125) Total: -103 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: do not ask for TLS-encrypted downloads on plain ftp:// URLsDenys Vlasenko2018-02-081-5/+7
| | | | | | | | | | | | | | function old new delta wget_main 2422 2431 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: shrink wget/tftp progress indicator code a bit moreDenys Vlasenko2018-02-071-29/+27
| | | | | | | | | | | | | | | | | | | | This makes size display 5-char wide instead of 6-char, but now it's smarter (can show sizes in "12.3M" format). function old new delta bb_progress_update 654 622 -32 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: shrink wget/tftp progress indicator code for 32-bitDenys Vlasenko2018-02-071-40/+38
| | | | | | | | | | | | | | function old new delta bb_progress_update 756 654 -102 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>