| Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
The command 'busybox --install -u' installs links to Unix-style
paths in the system drive.
|
|
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.
|
|
Use the new need_system_drive() function in httpd. Saves 16 bytes.
|
|
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.
|
|
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.
|
|
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.
|
|
Add another case where paths of the form 'c:path' need special
treatment.
Adds 16 bytes.
|
|
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.
|
|
The code for standalone shell mode should only be built for WIN32.
|
|
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.
|
|
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.
|
|
Attempting to set file ownership and permissions may not work
exactly as on *NIX.
|
|
- 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.
|
|
|
|
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.
|
|
Add -fno-builtin-strndup to the build flags, otherwise builds with
link-time optimisation can't find strndup.
|
|
|
|
|
|
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.
|
|
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.
|
|
Until now the emulated stat(2) system calls have only returned a
synthesised Unix-style mode value. Also return the raw Windows
file attributes.
|
|
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.
|
|
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.
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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>
|
|
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>
|
|
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'
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
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.
|