aboutsummaryrefslogtreecommitdiff
path: root/win32 (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-08-15busybox: create custom installation directoryRon Yorston1-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.
2020-08-14busybox: add option to install to Unix-style pathsRon Yorston2-12/+35
The command 'busybox --install -u' installs links to Unix-style paths in the system drive.
2020-08-13win32: use built-in applets for non-existent binaries with Unix-style pathsRon Yorston5-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.
2020-08-13httpd: code shrinkRon Yorston1-3/+2
Use the new need_system_drive() function in httpd. Saves 16 bytes.
2020-08-13win32: handle Unix-style absolute paths for executablesRon Yorston7-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.
2020-08-13win32: use a static buffer in get_system_drive()Ron Yorston4-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.
2020-08-13win32: code shrinkRon Yorston5-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.
2020-08-13which: handle paths of form 'c:path'Ron Yorston1-2/+5
Add another case where paths of the form 'c:path' need special treatment. Adds 16 bytes.
2020-08-05win32: move code to fork (de)compressor to a functionRon Yorston4-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.
2020-08-04which: rearrange conditional compilationRon Yorston1-1/+6
The code for standalone shell mode should only be built for WIN32.
2020-08-03win32: update strptime(3) implementationRon Yorston1-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.
2020-08-03build system: reinstate PLATFORM_LINUXRon Yorston2-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.
2020-08-03install: enable in default buildRon Yorston2-10/+14
Attempting to set file ownership and permissions may not work exactly as on *NIX.
2020-07-25win32: code shrink kill(2)Ron Yorston3-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.
2020-07-21win32: update link to Microsoft document on command-line argumentsRon Yorston1-1/+1
2020-07-19ts: correct output in 64-bit buildRon Yorston1-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.
2020-07-09win32: alter build flagsFRP-3532-g01a256149Ron Yorston1-1/+1
Add -fno-builtin-strndup to the build flags, otherwise builds with link-time optimisation can't find strndup.
2020-07-09win32: import strndup from gnulibRon Yorston3-0/+42
2020-07-09ash: tidy code, no functional changeRon Yorston1-3/+2
2020-07-09chattr, lsattr: enable in the default configurationRon Yorston6-7/+138
The chattr and lsattr utilities allow file attributes to be changed and displayed. Modify them to support Windows file attributes using the same names as Cygwin. Only allow a limited subset of attributes to be changed: just most of those supported by SetFileAttributes(). Since it isn't possible to set all attributes the '=' operator isn't allowed.
2020-07-09ls: treat hidden files as if their names begin with a dotRon Yorston1-0/+12
On Unix 'ls' treats filenames starting with a dot as hidden and only displays them if the '-a' or '-A' option is given. Extend similar treatment to files with the Windows hidden flag.
2020-07-09win32: return raw file attributes in struct mingw_statRon Yorston2-0/+5
Until now the emulated stat(2) system calls have only returned a synthesised Unix-style mode value. Also return the raw Windows file attributes.
2020-07-07ash: fix shell optionsRon Yorston1-7/+7
The Windows-specific shell options winxp, noconsole and nocaseglob have had the wrong indices in optlist since the merge with upstream BusyBox in commit 517cf74f6.
2020-06-30ash: improve handling of UNC pathsRon Yorston2-38/+56
Be more strict about identifying UNC paths in unc_root_len(). In updatepwd() in ash: - Skip duplicate leading slashes unless the directory is a UNC path. - Rewrite detection and handling of the five possible types of path. This improves cases like 'cd ///' and 'cd /xyz' when the current directory is a UNC path. See GitHub issue #192.
2020-06-30libbb: code shrink in last_char_is()Denys Vlasenko1-8/+9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29compare_string_array: code shrinkMartin Lewis1-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>
2020-06-29procps: code shrinkMartin Lewis1-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>
2020-06-29udhcpc: fix a TODO in fill_envp using option scannerMartin Lewis1-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>
2020-06-29udhcp: add option scannerMartin Lewis2-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>
2020-06-29wget: fix openssl options for cert verificationScott Court1-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>
2020-06-29acpid: only display -p if supported in usageNorbert Lange2-2/+4
Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29dhcpd: remove hardcoded pidfile pathNorbert Lange1-1/+7
Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29dpkg: prevent important directories from being removedNorbert Lange1-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>
2020-06-29nc_bloaty: support udp broadcast portsNorbert Lange1-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>
2020-06-29ash: avoid duplicated slashes in output of type/command builtinsRon Yorston2-0/+10
Microsoft developers have a penchant for adding trailing slashes to entries in PATH: C:/Windows/System32/WindowsPowerShell/v1.0/ C:/Windows/System32/OpenSSH/ The 'type' and 'command -v' shell builtins return paths with duplicated slashes for executables in those directories. See GitHub issue #191. Bonus fixes: - handle backslashes as well as slashes in concat_path_file() - convert backslashes to slashes in the output of 'type', 'command -v'
2020-06-26Start 1.33.0 development cycleDenys Vlasenko1-2/+2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-26Bump version to 1.32.01_32_0Denys Vlasenko1-1/+1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-25gzip -d with zcat enabled but gunzip disabled was misbehavingDenys Vlasenko1-1/+1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24make_single_applets.sh: switch off nologin deps optionDenys Vlasenko1-0/+2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24bc: placate a "defined but not used" warningDenys Vlasenko1-0/+2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24nologin: make it possible to build it as single appletDenys Vlasenko5-64/+110
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24suppress a few compile warningsDenys Vlasenko2-2/+2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24randomconfig fixesDenys Vlasenko3-2/+6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23randomconfig fixesDenys Vlasenko6-6/+31
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23randomconfig fixDenys Vlasenko1-0/+4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23randomconfig fixesDenys Vlasenko1-0/+1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23randomconfig fixesDenys Vlasenko2-1/+5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-23randomconfig fixesDenys Vlasenko2-0/+4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-21ash: skip NULL argv during forkshellRon Yorston1-67/+44
Alter argv_size()/argv_copy() to omit argv from the forkshell block if it's NULL. Improve forkshell debug code to properly account for parts of funcblock which aren't being used.
2020-06-21examples/udhcp/simple.script: fix IPv6 support when using udhcpcStefan Agner1-1/+1
The udhcpc script calls ip addr flush .. which flushes addresses of any address family, including IPv6. However, busybox udhcpc is IPv4 only and should not influence IPv6 addressing. Hence use ip addr flush with family constraint. The script particularly broke IPv6 SLAAC: Typically when udhcpc calls the script the kernel already assigned the IPv6 link-local address. The flush removes the link-local IPv6 address again and prohibits proper IPv6 operation such as SLAAC since neighbor discovery protocol relies on IPv6 link-local addressing. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [Taken from https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/busybox/files/simple.script?id=b77541dbb2f442e51842f9d24c8745a6df2d1478] Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>