| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of stat(2) detected whether a pathname ending
with a directory separator was valid by checking for the error
code ERROR_INVALID_NAME when GetFileAttributesExA() failed.
This works if the path refers to an actual disk but not if it's on
a share. In the latter case the glob '*/' incorrectly returned files
that weren't directories.
Add code to handle this case.
Costs 16-32 bytes.
(GitHub issue #381)
|
|
|
|
|
|
|
| |
Add a convenience function to determine if the last character of
a string is a directory separator.
Adds 16-32 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
busybox-w32 binaries built using clang crashed so frequently that
they were pretty much unusable. The main issue seems to be with
assignments to the structures containing global variables which
are used in most applets.
Upstream commit 5156b2455 (Make const ptr assign as function call
in clang) addresses this, but is insufficient for the build on
Windows. Extend the idea to the ASSIGN_CONST_PTR() macro too.
Costs 32-80 bytes in the gcc build.
|
|
|
|
|
|
|
|
|
|
| |
Commit 7390f29cf (build system: allow building with w64devkit)
checked the target of the host compiler to determine if it was
Windows. This relied on the target being a triple of the form
*-*-mingw32.
Some compilers have a target of the form *-*-windows-gnu. Allow
for this too.
|
|
|
|
|
|
| |
Use getpid() instead of GetProcessId(GetCurrentProcess()).
Saves 16 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
create_detached_process() is only used when running a CGI script.
Previously it leaked the return values from quote_arg() but freed
the command line it built.
Whether or not the CGI script is successfully run its parent process
exits almost immediately, so there's no pressing need to free the
memory. If FEATURE_CLEAN_UP is disabled (which it is by default)
don't bother.
Saves 16 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since clang doesn't seem to know about ffs(3) make it use
__builtin_ffs() instead.
Fix a warning in process_escape() in winansi.c: result of comparison
of constant -1 with expression of type 'WORD' (aka 'unsigned short')
is always true. Change the error value returned by process_colour()
from -1 to 0xffff.
Costs 16 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 7b692ddf0 (ash: improved support for jobs built-in) didn't
correctly initialise the pointer to the job table if it was empty.
This resulted in the following crashing:
sh -c "cat <(echo HelloWorld | rev)"
Fix forkshell_copy() so the job table pointer is NULL if there are
no jobs.
Adds 16 bytes.
(GitHub issue #379)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a build command fails and the '-k' option (continue on error)
is in effect, no further commands should be executed for the
current target.
Also, the resulting diagnostic should be reported to stderr. As
should the final 'not built due to errors' diagnostic.
Adds 80 bytes.
(pdpmake GitHub issue 35)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upstream code uses fork/exec when running a CGI process.
Emulate this by:
- Spawning a child httpd process with the special '-I 0' option,
along with the options provided on the server command line. This
sets up the proper state then calls the cgi_handler() function.
- The cgi_handler() function fixes the pipe file descriptors and
starts another child process to run the CGI script.
These processes are detached from the console on creation. When
spawn() functions are run in P_DETACH mode they don't connect to
the standard file descriptors. Normally this doesn't matter but
the process which runs the CGI scripts needs to inherit the pipe
endpoints. The create_detached_process() function handles this.
See:
https://github.com/rprichard/win32-console-docs/blob/master/README.md
Adds about 2.9Kb to the size of the binary.
(GitHub issue #266)
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 6d6856355a (win32: handle -1 return status from execve(2))
added a test of errno to distinguish between failure to run a
program and the program returning -1.
Subsequent changes in commit 9db9b34ada (win32: ignore ctrl-c in
parent of execve(2)) make this test unnecessary. Remove it.
Saves 16-32 bytes.
|
|
|
|
|
|
|
|
|
|
|
| |
When httpd was run in the background the return code of the parent
process was incorrect. It seems when spawn() is run in _P_DETACH
mode it returns 0 on success, not a process handle.
Fix the test for the return code and alter mingw_spawn_detach()
so it doesn't treat the return from spawn() as a handle.
Saves 32 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 2af141a2c (ash: changes to login shell functionality)
httpd has failed to run in the background (i.e. without the '-f'
option).
This was due the removal of support for applet names with a '-'
prefix. Although this feature isn't used by the shell it was used
by httpd to mark when the process had been daemonised.
Adds 16 bytes.
(GitHub issue #378)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the ability to override an applet if an external binary was
present was added, the commit message for bd7018350 said:
This doesn't affect tab completion in the shell: whether a
completion is an applet or an external command is irrelevant.
This isn't quite true. Suppose 'applet' has been overridden in
such circumstances:
$ export BB_OVERRIDE_APPLETS=";applet"
$ applet
If the user now enters tab twice the output would be:
applet applet.exe
The applet is still treated as a potential match. Recent changes
to the applet override code result in a simple fix: the shell PATH
can be passed to is_applet_preferred() in the line editing code.
Now only 'applet.exe' is treated as a match.
Adds 16-32 bytes.
|
|
|
|
|
| |
This doesn't affect the generated binary, at least in the default
configuration.
|
|
|
|
|
|
|
| |
If stdout is fully buffered (e.g. because the output is redirected
to a file or pipe) the command string may appear after its output.
(pdpmake GitHub PR 34)
|
|
|
|
|
|
|
|
| |
Pass the PATH to be used to look up executables down from the shell
to the applet override code. This replaces the use of a static
variable and a function to fetch its value.
Saves 16-32 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The environment variable BB_OVERRIDE_APPLETS provides control over
which applets are preferred in standalone shell mode. Allow a
similar list to be hardcoded in the binary with the OVERRIDE_APPLETS
configuration string.
The environment variable is checked first. If it doesn't override
the applet the hardcoded string is then checked too.
The default for OVERRIDE_APPLETS is an empty string. In this case
the size and behaviour of the binary is unchanged.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Display VSZ[RW] fields in more compact form if PID is wider.
function old new delta
display_topmem_process_list 564 614 +50
ulltoa5_and_space - 14 +14
ulltoa6_and_space 14 - -14
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 64/-14) Total: 50 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| | |
Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
start_stop_daemon_main 1186 1206 +20
bb_daemonize_or_rexec 196 212 +16
bb_banner 47 46 -1
packed_usage 34656 34645 -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 36/-12) Total: 24 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If specified redirect command stdout and stderr to given pathname.
function old new delta
start_stop_daemon_main 1130 1186 +56
start_stop_daemon_longopts 164 173 +9
packed_usage 34653 34656 +3
.rodata 105384 105386 +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 70/0) Total: 70 bytes
Signed-off-by: Louai Al-Khanji <louai@astranis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
4c20d9f2b removed FEATURE_FLOAT_SLEEP option, thus since then there are
only two variants.
Fixes: 4c20d9f2b ("extend fractional duration support to "top -d N.N" and "timeout"")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add option to change the running directory before starting the process.
This can be done using -d or --chdir options. Add also test cases to
start-stop-daemon to test out the directory change option.
function old new delta
packed_usage 34602 34648 +46
start_stop_daemon_main 1107 1130 +23
start_stop_daemon_longopts 156 164 +8
.rodata 105382 105384 +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 79/0) Total: 79 bytes
Signed-off-by: ejaaskel <esa.jaaskela@suomi24.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
.rodata 105381 105382 +1
packed_usage 34638 34602 -36
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-36) Total: -35 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I noticed a commit in connman:
"gdhcp: Avoid leaking stack data via unitiialized variable" [1]
Since gdhcp is just BusyBox udhcp with the serial numbers filed off, I
checked if BusyBox udhcp has a related issue.
The issue is that the get_option logic assumes any data within the
memory area of the buffer is "valid". This reduces the complexity of the
function at the cost of reading past the end of the actually received
data in the case of specially crafted packets. This is not a problem
for the udhcp_recv_kernel_packet data path as the entire memory
area is zeroed. However, d4/d6_recv_raw_packet does not zero the
memory.
Note that a related commit [2] is not required as we are zeroing
any data that can be read by the get_option function.
[1] https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=a74524b3e3fad81b0fd1084ffdf9f2ea469cd9b1
[2] https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=58d397ba74873384aee449690a9070bacd5676fa
function old new delta
d4_recv_raw_packet 484 497 +13
d6_recv_raw_packet 216 228 +12
.rodata 105390 105381 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 25/-9) Total: 16 bytes
Signed-off-by: Russ Dill <russ.dill@gmail.com>
Cc: Colin Wee <cwee@tesla.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
syslogd_init 1007 1140 +133
create_socket 143 - -143
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 133/-143) Total: -10 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
awk_main 843 891 +48
next_input_file 243 261 +18
packed_usage 34631 34638 +7
.rodata 105391 105390 -1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 73/-1) Total: 72 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since Linux 2.2.13, chown(2) resets the suid/gid bits for all users.
This patch changes the ordering so that chmod gets called after chown.
This behavior follows GNU coreutils.
Signed-off-by: Nero <nero@w1r3.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
sleep_main 116 119 +3
printf_main 860 837 -23
single_argv 50 25 -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 3/-48) Total: -45 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mingw_fork_compressor() uses CreateProcess() to run the compressor
program. This will often be an instance of BusyBox, but since the
xv and lzma applets in BusyBox don't support compression it can be
an external program.
It was intended that the external program should be found using PATH.
However, CreateProcess() looks in various other places before trying
PATH. In particular, it first looks in the directory of the current
executable, then in the current directory of the process. This can
result in the wrong xz.exe or lzma.exe being found.
Perform an explicit PATH search and force CreateProcess() to use the
result.
This change only affects the search for a compressor. The same
problem also affects other uses of our popen(3) emulation. These
may be addressed in future.
Costs 64-80 bytes.
(GitHub issue #376)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Part of commit 412c2cab62 (iconv: minor fixes) was intended to
avoid having to enter ^Z twice to signal EOF when input was coming
from the console. Unfortunately there were unintended consequences.
Use a different method to detect EOF.
Costs 32-48 bytes.
(GitHuv issue #374)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code to replace the user's home directory with '~' in the
prompt didn't allow for the possibility of the HOME environment
variable having backslashes in the path.
Convert backslashes to forward slashes in HOME. This isn't necessary
if the home directory is obtained from getpwuid(3) as it's already
converted there.
Adds 24-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When checking target names or looking for a target rule be more
strict about the form of Windows paths allowed.
Alter the error message when neither a target rule or macro
assignment has been detected.
Adds 88-96 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 87a3ddc06 (win32: avoid terminal weirdness induced by Gradle?)
correctly diagnosed the problem but got the cure wrong.
Reset DISABLE_NEWLINE_AUTO_RETURN in the new mode, not the old one.
Otherwise the change isn't applied.
Saves 48 bytes.
(GitHub issue #372)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The presence of an equal sign in an inline command on a target
rule caused the line to be detected as a macro assignment.
For example:
target:; @echo a = $(a)
Rearrange input parsing so target rules are detected before macro
assignments. This is made more complex by having to allow for the
':=', '::=' and ':::=' assignment operators. (And for targets
containing colons on Windows.)
Costs 240-248 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GitHub issue #372 reports that in certain circumstances (which I've
been unable to reproduce) Gradle leaves the terminal in a state
where linefeeds seem not to result in a carriage return.
This *might* be because Gradle sets DISABLE_NEWLINE_AUTO_RETURN in
the terminal mode. Reset DISABLE_NEWLINE_AUTO_RETURN to zero before
the shell prompt is issued to see of this makes any difference.
Costs 16-32 bytes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The 'make' applet follows POSIX requirements when setting the MAKE
variable. However, it doesn't allow for the case where argv[0] is
of a form like '/bin/make' but no corresponding executable exists.
This can happen in busybox-w32 when '/bin/make' is interpreted as
a reference to the 'make' applet.
In this case set the MAKE variable to argv[0] and avoid issuing a
warning.
Setting MAKE to something that isn't a real executable is fine so
long as it's only used by busybox-w32 applets. If it's used by
external applications they may get confused.
Adds 16-32 bytes.
(GitHub issue #354)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 548ec7045b (win32: interpret absolute paths as relative to
%SYSTEMDRIVE%) introduced the function xabsolute_path() to make
relative paths absolute. This is used in 'dkpg' and 'man' to
avoid having to tinker with absolute paths from upstream.
Unfortunately, it's too eager to use the relative path. This
results in dpkg failing to install deb files with a relative path.
Saves 32-48 bytes.
(GitHub issue #371)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add an implementation of strverscmp from musl so that the 'sort -V'
option works.
Add '-V' to the trivial usage message.
Costs 248-256 bytes.
(GitHub issue #370)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add shell options:
- 'nohiddenglob' excludes files with the hidden attribute from
globbing
- 'nohidsysglob' excludes files with the hidden and system attributes
from globbing
If both options are enabled 'nohiddenglob' takes precedence.
These options also affect tab completion.
Files that are hidden because they start with a period aren't
affected (unless they also have the hidden attribute).
Costs 160-208 bytes.
(GitHub issue #367)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 603af9bb9 (win32: support "app exec link" reparse points)
added support for IO_REPARSE_TAG_APPEXECLINK reparse points by
pretending they're symbolic links.
One change was missed, in the implementation of dirent.
Costs 16 bytes.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default configurations now include the provided standard or
UTF-8 manifest.
This works best if the build toolchain doesn't provide a default
manifest (which Fedora and w64devkit don't, by default).
If the toolchain does have a default manifest some bloat will
result.
(GitHub issue #366)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The UTF-8 manifest has been updated to include features from the
standard application manifest.
Include a copy of the standard application manifest for toolchains
that don't provide one.
(GitHub issue #366)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add two utility functions to convert Windows process exit codes.
- exit_code_to_wait_status() converts to a POSIX wait status.
This is used in ash and the implementations of system(3) and
mingw_wait3().
- exit_code_to_posix() converts to a POSIX exit code. (Not that
POSIX has much to say about them.)
As a result it's possible for more applets to report when child
processes are killed as if by a signal. 'time', 'drop' and 'su -W',
for example.
Adds 64-80 bytes.
|