| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Interface may not exist because it got deleted by an ifdown hook script
earlier. This may happen when a virtual interface, such as VLAN, has multiple
iface blocks defined.
function old new delta
static_down6 14 40 +26
static_down 54 70 +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 42/0) Total: 42 bytes
Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
INET6_setroute 492 472 -20
do_iplink 1357 1330 -27
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-47) Total: -47 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we don't ask for numerical output, and the symbolic look-up failed
we used to get "(null)", but the numeric output would be better.
function old new delta
ip_port_str 109 121 +12
Signed-off-by: Mark Marshall <mark.marshall@omicronenergy.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The wrong character was used to indicate options taking an integer
parameter.
Signed-off-by: Ron Yorston <rmy@pobox.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>
|
| |
| |
| |
| |
| |
| |
| | |
-o Don't restore user:group
-k Don't replace existing files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
|
| |
| |
| |
| |
| |
| | |
Upstream BusyBox removed the global funcblocksize variable. Instead
a local variable with the same name is passed to and returned from
all functions that calculate item sizes. Do the same here.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream BusyBox removed the funcstringsize variable. String sizes
are included in funcblocksize then strings are copied into the data
block starting from the end. Do the same here.
Add a function to calculate string lengths, allowing for NULL string
pointers (as nodeckstrup does already for MinGW).
|
| |
| |
| |
| |
| |
| | |
Put the nodeptr array before funcblock and funcstring. Since nodeptr
now immediately follows the forkshell structure in the data block we
can declare it in the structure and do away with nodeptr_offset.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use library routines to reduce the amount of code needed to strip
the extension from argv[0] in the BusyBox main function.
The name of the executable can now have any of the standard
extensions, none at all, or a trailing dot.
Related to GitHub issue #20.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit db03ff5ea made some improvements to the handling of builtin
environment variables during forkshell. However, more can be done.
Currently the calculated size of varinit doesn't match what's actually
copied. It overestimates the amount of string space and the number
of pointers. The text of each builtin environment variable is also
copied twice: once as part of vartab and again from varinit.
Remove the code to copy varinit via the forkshell block. Instead
use information from vartab and varinit_data to reinitialise varinit
and fix the links in vartab.
In addition, ensure that the LINENO variable is properly initialised
in the child.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Clearing the environment on Microsoft Windows results in pointers
used for shell variables becoming invalid. Take copies when the
environment is imported.
This only affects NOFORK applets invoked by tryexec, but the number
of NOFORK applets has increased considerably in recent years.
|
| |
| |
| |
| |
| |
| | |
The --list-full option to busybox-w32 was disabled because it didn't
make sense to display Unix install paths. Repurpose this option
to display whether applets are NOFORK or NOEXEC.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The exit status from _cwait wasn't being correctly returned. This
resulted, for example, in the exit status of xargs being incorrect.
Running this:
$ ls | xargs ls
in a directory containing filenames with spaces should cause 'ls' to
fail and 'xargs' to return an exit status of 123.
|
| |
| |
| |
| |
| |
| |
| |
| | |
In the recently-added code to pass applet names to child processes use
local arrays to build the environment variables rather that allocating
them every time.
mingw_spawn can call mingw_spawn_proc instead of mingw_spawn_1.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In standalone shell mode all busybox-w32 applets are displayed as
'busybox.exe' in a process listing.
I haven't found a satisfactory way to query a running instance of
busybox-w32 to determine which applet it's running. Handle a couple
of cases:
- the process running the process scan knows its own PID and knows
which applet it is;
- just before invoking applet_main set an environment variable whose
name contains the PID and whose value is the current applet name.
Children running a process scan will inherit their parent's environment
and can therefore match the parent's PID to its applet name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original procps_scan function takes care to clear the status
information before handling each process. Do the same for the
WIN32 version.
This requires moving the snapshot handle to the part of the structure
that isn't cleared on each iteration.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If icons are enabled we might as well store some version information.
The string manipulation is based on this:
https://stackoverflow.com/questions/8540485/how-do-i-split-a-string-in-make
Closes issue #108.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When signal 0 is sent to the child process both coreutils and BusyBox
timeout allow the child to continue running. busybox-w32 was sending
the signal and then killing the child: be consistent.
When timeout is interrupted by SIGTERM or Ctrl-C from an interactive
shell kill the child too.
|
| |
| |
| |
| |
| | |
When Ctrl-C is pressed try killing processes with SIGTERM initially.
If they're still running after a short pause use sterner measures.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The names of the callbacks to kill processes with a given signal were
confusing because they referred to the implementation rather than
the intent.
Create the new function kill_SIGTERM_by_handle which is more efficient
when a handle to the process to be killed is already available.
|
| |
| |
| |
| |
| | |
Include two styles of icon from the GNOME Adwaita theme. These
are enabled by default and add 30 Kbytes to the size of the binary.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Coreutils documentation says of the exit status:
124 if command times out
125 if timeout itself fails
126 if command is found but cannot be invoked
127 if command cannot be found
137 if command is sent the KILL(9) signal (128+9)
the exit status of command otherwise
Make busybox-w32 'timeout' behaviour match this. Upstream BusyBox
is unaffected.
See GitHub issue #105.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Allow either ISAAC or the shell's built-in pseudo-random number
generator to be used for /dev/urandom. The latter is smaller so
it's the default.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Reduce the size of the binary by about 32 bytes:
- use xzalloc to allocate static buffers so we don't have to
initialise them;
- avoid duplicated code in spawnveq.
|
| |
| |
| |
| |
| |
| |
| | |
Add a 'man' directory in the same directory as the current BusyBox
executable to the end of the list of paths searched for man pages.
See GitHub issue #102.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Moving detection of file formats from access(2) to stat(2) in
commit 650f67507 was acknowledged to slow down stat. One
problematic case is c:/windows/system32 which contains about
2000 DLLs and was found to slow 'ls' unacceptably.
Treat DLLs as a special case in has_exec_format.
See GitHub issue #101.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reading the attributes of files like c:/pagefile.sys fails with
error code ERROR_SHARING_VIOLATION, which breaks 'ls'.
If this happens try an alternative API call to get the attributes.
See GitHub issue #101.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make mingw_popen_fd sufficiently general that it can be used to
implement the other two popen routines.
mingw_popen now just creates a command line and passes it to
mingw_popen_fd. The one call to mingw_popen2 has been replaced
by a call to mingw_popen_fd.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow wget to support https URLs. Changes are:
- Add mingw_popen2 which uses a named pipe to allow bidirectional
communication with a child process;
- Modify ssl_client to accept a WIN32 handle instead of a file
descriptor as an argument;
- Allow tls_get_random to open /dev/urandom;
- Using the above changes implement a WIN32 version of spawn_ssl_client
in wget.
This closes GitHub issue #75.
Also, enable authentication in wget.
|
| |
| |
| |
| |
| | |
Since device files are now handled in mingw_open there's no need
for any special treatment in ash redirection.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Handling of the special devices /dev/zero and /dev/urandom was
inconsistent:
- they could be used as arguments to 'cat' but not 'od';
- they could not be used in shell redirection.
Restrict the use of these devices to two places:
- as input files to 'dd' with the 'if=' argument;
- internally within 'shred'.
See GitHub issue #98.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
text data bss dec hex filename
933035 473 6836 940344 e5938 busybox_old
933051 473 6836 940360 e5948 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
defaultpro 14 - -14
defaultmap 17 - -17
readprofile_main 1762 1719 -43
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 0/1 up/down: 0/-74) Total: -74 bytes
text data bss dec hex filename
933081 473 6836 940390 e5966 busybox_old
933035 473 6836 940344 e5938 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
update_local_clock 834 858 +24
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
EINTR _should_ only happen on two signals we trap, and safe_poll
_should_ work here just fine, but there were kernel bugs where spurious EINTRs
happen (e.g. on ptrace attach). Be safe.
function old new delta
udhcpd_main 1437 1468 +31
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In other words: try to correct initially existing clock offset first,
before assuming that our clock drifts.
function old new delta
update_local_clock 826 834 +8
ntp_init 550 557 +7
filter_datapoints 179 173 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 15/-6) Total: 9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes:
commit 52a515d18724bbb34e3ccbbb0218efcc4eccc0a8
"udhcp: use poll() instead of select()"
Feb 16 2017
udhcp_sp_read() is meant to check whether signal pipe indeed has some data to read.
In the above commit, it was changed as follows:
- if (!FD_ISSET(signal_pipe.rd, rfds))
+ if (!pfds[0].revents)
return 0;
The problem is, the check was working for select() purely by accident.
Caught signal interrupts select()/poll() syscalls, they return with EINTR
(regardless of SA_RESTART flag in sigaction). _Then_ signal handler is invoked.
IOW: they can't see any changes to fd state caused by signal haldler
(in our case, signal handler makes signal pipe ready to be read).
For select(), it means that rfds[] bit array is unmodified, bit of signal
pipe's read fd is still set, and the above check "works": it thinks select()
says there is data to read.
This accident does not work for poll(): .revents stays clear, and we do not
try reading signal pipe as we should. In udhcpd, we fall through and block
in socket read. Further SIGTERM signals simply cause socket read to be
interrupted and then restarted (since SIGTERM handler has SA_RESTART=1).
Fixing this as follows: remove the check altogether. Set signal pipe read fd
to nonblocking mode. Always read it in udhcp_sp_read().
If read fails, assume it's EAGAIN and return 0 ("no signal seen").
udhcpd avoids reading signal pipe on every recvd packet by looping if EINTR
(using safe_poll()) - thus ensuring we have correct .revents for all fds -
and calling udhcp_sp_read() only if pfds[0].revents!=0.
udhcpc performs much fewer reads (typically it sleeps >99.999% of the time),
there is no need to optimize it: can call udhcp_sp_read() after each poll
unconditionally.
To robustify socket reads, unconditionally set pfds[1].revents=0
in udhcp_sp_fd_set() (which is before poll), and check it before reading
network socket in udhcpd.
TODO:
This might still fail: if pfds[1].revents=POLLIN, socket read may still block.
There are rare cases when select/poll indicates that data can be read,
but then actual read still blocks (one such case is UDP packets with
wrong checksum). General advise is, if you use a poll/select loop,
keep all your fds nonblocking.
Maybe we should also do that to our network sockets?
function old new delta
udhcp_sp_setup 55 65 +10
udhcp_sp_fd_set 54 60 +6
udhcp_sp_read 46 36 -10
udhcpd_main 1451 1437 -14
udhcpc_main 2723 2708 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/3 up/down: 16/-39) Total: -23 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
packed_usage 32547 32550 +3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|