| Commit message (Collapse) | Author | Age | Files | Lines |
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The LOOP_CONFIGURE ioctl is supported in 5.8 kernels and up. To have
backwards compatibility there is a config option CONFIG_TRY_LOOP_CONFIGURE
that will check if the ioctl exists and if not fall back to old way of
configuring loop devices.
Normally errno will be set to EINVAL when this ioctl does not exist.
However, when kernel config CONFIG_COMPAT is enabled, then compat_ioctl
is called. In that case -ENOIOCTLCMD is returned by loop device driver
and generic ioctl wrapper will set errno to ENOTTY. Because busybox
does not expect this it will fail to mount loop devices in this case.
This patch fixes the check for the existence of the ioctl LOOP_CONFIGURE
by checking if errno is one of both: EINVAL or ENOTTY.
function old new delta
set_loop 809 821 +12
Signed-off-by: Wouter Franken <wouter.franken_ext@softathome.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If an element of $PATH had a trailing slash 'which' displayed two
slashes when an executable was found in that directory.
This is a regression caused by upstream commit 49d9e06fb (libbb:
modify find_executable() to not temporarily write to PATH).
Prior to this commit find_executable() used concat_path_file() to
build the path of the executable. This avoids including duplicate
slashes in its output. The new code didn't.
Add a test in find_executable() to detect the problem. It still
fails if there are multiple trailing slashes. Don't do that.
Adds 48 bytes.
|
| | |
| |
| |
| |
| |
| |
| | |
Fix some compiler warnings and move the CNG algorithm caches into
get_alg_handle().
Saves 32 bytes in the x86_64 build with CNG enabled.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The existing CNG implementation relied on multiple features only
implemented in "newer" Windows versions. This new implementation does
not use the aforementioned features and is therefore compatible with
systems running Windows Vista or higher.
function old new delta
.rdata 87112 87288 +176
hmac_peek_hash 80 208 +128
get_alg_handle - 96 +96
algorithm_provider_hmac_cache - 48 +48
algorithm_provider_cache - 48 +48
alg_id_mappings - 48 +48
sha512_begin 16 48 +32
sha384_begin 16 48 +32
sha256_begin 16 48 +32
sha1_begin 16 48 +32
md5_begin 16 32 +16
hmac_hash_v 48 64 +16
hmac_end 48 64 +16
hmac_blocks.constprop.0 96 112 +16
__imp_BCryptOpenAlgorithmProvider - 8 +8
__imp_BCryptDuplicateHash - 8 +8
BCryptOpenAlgorithmProvider - 8 +8
BCryptDuplicateHash - 8 +8
------------------------------------------------------------------------------
(add/remove: 8/0 grow/shrink: 10/0 up/down: 768/0) Total: 768 bytes
|
| | |
| |
| |
| |
| | |
One more from the POSIX documentation and some examples from
coreutils.
|
| | |
| |
| |
| |
| |
| | |
Used the command:
./scripts/mkwcwidth DL=latest FAST_FUNC > libbb/wcwidth_alt.c
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Updated using:
./scripts/mkwcwidth DL=16.0.0 FAST_FUNC > libbb/wcwidth_alt.c
The latest currently is 17.0.0, but because we were previously with
15.1 tables, have the 16.0 tables in history just in case.
Next commit will update to the latest version.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, scripts/mkwcwidth generated a wcwidth implementation based
on input from the python wcwidth: https://github.com/jquast/wcwidth .
However, that project is not updated frequently, and the less
dependencies - the better.
This new script instead prints an implementation based directly on the
original Unicode files - which it can also download.
It generates the same code as before (same data structures, etc).
It was then used to re-generate libbb/wcwidth_alt.c, as follows:
./scripts/mkwcwidth DL=15.1.0 FAST_FUNC > libbb/wcwidth_alt.c
This is the same Unicode version as the previous file, just to make
the codepoint differences visible easily.
These differences are very small, and the script itself explains where
and why it differs from https://github.com/jquast/wcwidth .
Next commits will update the tables to the latest unicode version.
|
| | |
| |
| |
| |
| |
| |
| | |
The next commit will replace scripts/mkwcwidth, and the new script
doesn't add codepoint comments, so delete the comments now, so that
it would be easier to compare wcwidth_alt.c when it's updated using
the new script.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When unicode is enabled at build time, but disabled at runtime
(commit 208649d7), we already do some runtime ACP tests and act
accordingly (we know unicode is not in effect) in mingw non-upstream
code (UTF8_OUTPUT, etc - see previous commit).
However, there's at least one upstream unicode code path which was
not touched until now - printable chars.
This code is used by applets like "ls" to display "?" instead of
non-printable chars, where upstream considers byte values above 127
as non-printable, but the busybox-w32 code should consider them
printable when unicode is disabled (ANSI codepage).
We already have code for that when unicode is disabled at build time
(at printable_string2), but when unicode is enabled at build time then
it enters a different code path (which still tests dynamically whether
unicode is enabled - and correctly deduces that it isn't when unicode
is disabled despite the utf8 manifest).
Modify unicode_conv_to_printable2 similar to how printable_string2 is
modified - but only when unicode is disabled due to the manifest not
being in effect (unicode build on win XP/7/8).
A unicode build on XP/7/8 _should_ now behave reasonably close to
a non-unicode build on such systems.
Known issues:
There's one known issue, and that's tab completion doesn't case-fix
the completion. E.g. ~/desk<tab> completes to ~/desktop/ instead of
to ~/Desktop/ (capital D).
This issue exists in unicode builds also on win10+, and is caused by
the fact that when unicode is enabled at build-time, line-editing
uses (32bit) wchar_t, and of the mingw changes in line-edit, only
the backslash-to-slash was ported also to the wchar_t editing, while
case-fix was not (see FIXME at libbb/lineedit.c in commit 0efc7474).
status:
This combination of unicode-enabled build running on XP/7/8 was NOT
tested extensively, so some issues might remain, but other than the
case-fix with tab-completion, there are no known issues.
Main area where more testing is needed is editing (probably mainly
interactive shell command prompt and vi).
Testing:
To test how a unicode-enabled build behaves when unicode is disabled
in runtime, other than actually running it on win XP/7/8, one way
would be to find a combination of build-config values to enable all
the unicode features but not the manifest itself, but that's tricky.
Instead, one could simply delete the manifest from a pre-compiled
binary (mingw{64u,32w}_defconfig), so that it would run in ANSI mode
even on win10+, with the build-time unicode code paths still enabled
at the binary.
One tool to edit windows binaries is https://github.com/avih/perc .
To delete the manifest, use "perc -D -t MANIFEST busybox.exe" .
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that a binary with a UTF-8 manifest can run on Windows XP
it's possible to configure a build which supports Unicode on
Windows 10+ but which still runs on legacy systems.
- Add the config file mingw32w_defconfig. This is a 32-bit build
with the UTF-8 manifest which also runs on legacy systems.
- A new config option, FEATURE_FAIL_IF_UTF8_MANIFEST_UNSUPPORTED,
allows the check for legacy systems to be skipped.
- An incompatibility with Windows XP in writeCon_utf8() has been
fixed.
See this GitHub issue for details:
https://github.com/skeeto/w64devkit/issues/315
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'\W' in PS1 returned an empty string for the root directory. bash
displays '/' in similar circumstances.
Avoid returning an empty string for the directory.
function old new delta
parse_and_put_prompt 873 883 +10
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
busybox_main 695 734 +39
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
sig_unblock 41 43 +2
sig_block 41 40 -1
sigprocmask_allsigs 33 31 -2
wait_for_child_or_signal 202 193 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-12) Total: -10 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream commit:
Date: Sat, 19 May 2018 02:39:56 +0800
eval: Add vfork support
This patch adds basic vfork support for the case of a simple command.
Upstream commit:
Date: Tue, 12 Jan 2021 17:11:19 +1100
jobs: Always reset SIGINT/SIGQUIT handlers
On Fri, Jan 08, 2021 at 08:55:41PM +0000, Harald van Dijk wrote:
> On 18/05/2018 19:39, Herbert Xu wrote:
> > This patch adds basic vfork support for the case of a simple command.
> > ... @@ -879,17 +892,30 @@ forkchild(struct job *jp, union node *n, int
> > mode)
> > }
> > }
> > if (!oldlvl && iflag) {
> > - setsignal(SIGINT);
> > - setsignal(SIGQUIT);
> > + if (mode != FORK_BG) {
> > + setsignal(SIGINT);
> > + setsignal(SIGQUIT);
> > + }
> > setsignal(SIGTERM);
> > }
> > +
> > + if (lvforked)
> > + return;
> > +
> > for (jp = curjob; jp; jp = jp->prev_job)
> > freejob(jp);
> > }
>
> This leaves SIGQUIT ignored in background jobs in interactive shells.
>
> ENV= dash -ic 'dash -c "kill -QUIT \$\$; echo huh" & wait'
>
> As of dash 0.5.11, this prints "huh". Before, the subprocess process killed
> itself before it could print anything. Other shells do not leave SIGQUIT
> ignored.
>
> (In a few other shells, this also prints "huh", but in those other shells,
> that is because the inner shell chooses to ignore SIGQUIT, not because the
> outer shell leaves it ignored.)
Thanks for catching this. I have no idea how that got in there
and it makes no sense whatsoever. This patch removes the if
conditional.
Fixes: e94a964e7dd0 ("eval: Add vfork support")
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
Merge upstream commit df154028d. Since we don't have vfork() on
Windows we continue to use the spawn_forkshell() mechanism.
Although there is some rearrangement of the code it's functionally
the same.
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
procps_read_smaps 515 529 +14
procps_get_maps 685 665 -20
.rodata 105847 105820 -27
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-47) Total: -33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| | |
Space was too inconspicuous on output
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
An upstream bug caused '\W' to return an empty string for the
root directory of any drive. bash displays '/' in similar
circumstances on Linux.
Adds 16 bytes.
(GitHub issue #516)
|
| |\| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
cmdline_to_line_buf_and_print - 48 +48
read_cmdline 326 327 +1
display_topmem_process_list 523 505 -18
display_process_list 1186 1161 -25
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/2 up/down: 49/-43) Total: 6 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The logic is in fact quite far from common.
While at it, stop accounting "---p" mappings as mapped (e.g. VSZ in top).
Nothing is mapped there (why would kernel waste RAM to map pages
which can't be accessed?).
function old new delta
read_smaps - 562 +562
read_cmdline 315 326 +11
print_smaprec 97 101 +4
procps_scan 1219 1211 -8
.rodata 115541 115533 -8
skip_whitespace_if_prefixed_with 25 - -25
procps_read_smaps 864 577 -287
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 2/3 up/down: 577/-328) Total: 249 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
display_process_list 1366 1403 +37
handle_input 628 636 +8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 45/0) Total: 45 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
concat_path_file 68 127 +59
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The check for "" history file is done on a wrong state pointer.
Fixes: shell: empty HISTFILE disables history saving, just as unset one did
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
modprobe_main 803 804 +1
escape_text 127 122 -5
replace 18 - -18
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 1/-23) Total: -22 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
display 1485 1481 -4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
static.PBKDF2_SHA256 219 165 -54
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
print_name 137 229 +92
display_files 375 402 +27
c_escape_conv_str00 - 24 +24
display 1476 1485 +9
conv_str 33 - -33
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 3/0 up/down: 152/-33) Total: 119 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
ls_main 598 660 +62
ls_longopts - 47 +47
G_isatty - 36 +36
print_name 102 134 +32
display_files 358 374 +16
.rodata 105829 105833 +4
vgetopt32 1330 1317 -13
static.ls_longopts 47 - -47
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 4/1 up/down: 197/-60) Total: 137 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
function old new delta
sha512384_end - 198 +198
packed_usage 35021 35134 +113
init384 - 80 +80
sha384_begin - 19 +19
sha384_end - 10 +10
applet_names 2823 2833 +10
md5_sha1_sum_main 501 507 +6
sha3_end 54 59 +5
applet_main 1628 1632 +4
show_usage_if_dash_dash_help 79 72 -7
hash_file 358 344 -14
sha512_end 197 10 -187
------------------------------------------------------------------------------
(add/remove: 4/0 grow/shrink: 5/3 up/down: 445/-208) Total: 237 bytes
Signed-off-by: Andy Knowles <aknowles@galleonec.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Upstream has moved some functions from networking/tls.c to a new
file, libbb/hash_hmac.c. The merge didn't adjust this code to
allow it to work with the native Windows checksum API.
This only matters if FEATURE_USE_CNG_API is enabled and
CONFIG_FEATURE_TLS_SCHANNEL isn't. In that case the wget applet
fails to handle https. None of the default configurations
has this combination, but it should work. Make it so.
The Windows code doesn't implement hmac_block(), as that's only
used for password encryption which isn't currently supported.
The variadic function hmac_peek_hash() isn't declared FAST_FUNC,
as that causes clang to issue many warnings.
|
| |\| |
|
| | |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
sha256_process_block64_shaNI 673 657 -16
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| | |
No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
salsa20 760 296 -464
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
crypt_make_pw_salt 128 146 +18
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The symptom is: "cryptpw ... implicit" testsuite tests were failing
if CONFIG_FEATURE_DEFAULT_PASSWD_ALGO is not "des".
function old new delta
cryptpw_main 223 283 +60
pw_encrypt 974 975 +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0) Total: 61 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
blockmix_xor_save 1169 708 -461
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
function old new delta
yescrypt_r 767 756 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|