| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Windows implementation of readlink(2) has caused problems in
the past. As, for example, with commit c29dc205d2 (win32: fix
implementation of readlink(2)).
Most uses of readlink(2) in BusyBox are actually calls to the
(considerably more convenient) library function xmalloc_readlink().
Implement a Windows version of that and used it instead of readlink(2).
This improves the handling of symbolic links (and similar reparse
points) in CJK and UTF-8 code pages.
Saves 48-80 bytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upstream commit 94eb1c4dc (libbb: better coreutils compatibility
for realpath) made some changes to xmalloc_realpath_coreutils().
This now needs to be updated to handle Windows paths.
- Expose the macro is_unc_path() and part of the recent change to
bb_get_last_path_component_nostrip() as a separate funtion,
get_last_slash();
- Convert a couple of errors relating to network filesystems to
ENOENT;
- Adjust xmalloc_realpath_coreutils() to handle Windows directory
separators, relative paths and UNC paths.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add some tests which coreutils realpath pass but BusyBox realpath
fails (bar one). Adjust xmalloc_realpath_coreutils() so the tests
pass:
- Expand symbolic links before testing whether the last path component
exists.
- When the link target is a relative path canonicalize it by passing
it through xmalloc_realpath_coreutils() as already happens for
absolute paths.
- Ignore trailing slashes when finding the last path component and
correctly handle the case where the only slash is at the start of
the path. This requires ignoring superfluous leading slashes.
- Undo all changes to the path so error messages from the caller show
the original filename.
function old new delta
xmalloc_realpath_coreutils 214 313 +99
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| | |
As the comment pointed out is_absolute_path() was misnamed. Rename
it to is_relative_path() and change the sense of all tests.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Our realpath(3) implementation uses xmalloc_follow_symlinks() to
expand symlinks. This detects when symlinks are too deeply nested
but didn't set errno, so anything calling realpath(3) was unable to
say what had gone wrong. (For example, 'ls -L' or 'stat -L'.)
Set errno to ELOOP.
This then leads to the problem that Windows doesn't know about
ELOOP so reports 'Unknown error'. Add a replacement for strerror(3)
which returns a sensible message.
Costs 96 bytes.
|
| |
| |
| |
| |
| |
| | |
In xmalloc_follow_symlinks() the code to detect relative paths
needs to be altered for WIN32. We don't want C:/path to be
treated as a relative path.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In e86a3ddd8 (win32: make readlink(2) implementation unconditional,
2021-02-12), we removed the special casing of `errno == ENOSYS` when
trying to follow symlinks. However, that handling really was necessary:
- When we followed a symlink, and found a non-symlink, and then called
`readlink()` with that non-symlink, we got `errno == ENOSYS` on
Windows (translated from `ERROR_NOT_A_REPARSE_POINT`), and we did
want to stop the loop and return the current path in that case.
(Noted by Johannes Schindelin.)
- When readlink() called DeviceIoControl() for files on certain
filesystems (e.g. FAT or a CDROM) it returned `errno == ENOSYS`
(translated from ERROR_INVALID_FUNCTION).
Revert the part of the patch which handled `ENOSYS` on Windows.
|
| |
| |
| |
| |
| |
| |
| | |
There doesn't seem to be much advantage in having readlink(2) as a
configuration option. Making it unconditional reduces divergence from
upstream and allows the removal of a check for ENOSYS that's been in
busybox-w32 since the start.
|
|\| |
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
xmalloc_realpath_coreutils 125 201 +76
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|\| |
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
| |
| |
| |
| |
| |
| |
| | |
function old new delta
xmalloc_realpath_coreutils - 121 +121
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|\| |
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
debianutils/which.c
editors/vi.c
libbb/executable.c
|
| |
| |
| |
| | |
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
archival/Config.src
shell/ash.c
|
| |
| |
| |
| |
| |
| |
| | |
This is needed for, eg, hurd, which is known to have no constraints.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|\| |
|
| |
| |
| |
| | |
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| | |
This change retains "or later" state! No licensing _changes_ here,
only form is adjusted (article, space between "GPL" and "v2" and so on).
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|/ |
|
|
|
|
|
| |
Signed-off-by: Jérémie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
libbb: make xmalloc_readlink_or_warn warning more specific.
function old new delta
xmalloc_readlink_or_warn 33 61 +28
showfiles 1495 1460 -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 28/-35) Total: -7 bytes
|
| |
|
|
|
|
|
|
|
| |
text data bss dec hex filename
808035 611 6868 815514 c719a busybox_old
804472 611 6868 811951 c63af busybox_unstripped
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
function old new delta
create_socket - 134 +134
syslogd_main 1132 865 -267
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 134/-267) Total: -133 bytes
text data bss dec hex filename
775603 974 9420 785997 bfe4d busybox_old
775445 974 9420 785839 bfdaf busybox_unstripped
|
|
|
|
|
|
|
| |
- use common exit sequence for failure path:
text data bss dec hex filename
308 0 0 308 134 libbb/xreadlink.o.pgf
296 0 0 296 128 libbb/xreadlink.o
|
|
|
|
|
| |
return full path in cases where path doesn't resolve to a link.
change name to better differentiate from xmalloc_readlink().
|
|
|
|
|
|
|
|
|
|
| |
udhcp: add missing tryagain member to client_config
function old new delta
xmalloc_readlink_follow 169 154 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-15) Total: -15 bytes
|
|
|
|
| |
to get to a "real" file (or directory).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function old new delta
add_ksymoops_symbols - 421 +421
static.section_names 20 40 +20
lsmod_main 425 424 -1
set_tainted 153 150 -3
main_opts 4 - -4
obj_symbol_patch 47 42 -5
obj_string_patch 144 139 -5
already_loaded 144 138 -6
check_dep 348 341 -7
append_option 75 68 -7
obj_allocate_commons 515 501 -14
new_process_module_arguments 1039 1018 -21
arch_new_symbol 31 9 -22
check_module_name_match 85 61 -24
obj_create_alloced_section 164 136 -28
include_conf 930 902 -28
modprobe_main 1643 1535 -108
obj_load 924 777 -147
insmod_ng_main 245 - -245
insmod_main 4122 3794 -328
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 1/16 up/down: 441/-1003) Total: -562 bytes
text data bss dec hex filename
776020 974 9420 786414 bffee busybox_old
775384 974 9420 785778 bfd72 busybox_unstripped
|
|
|
|
|
| |
libbb: comment out realpath, add readlink which doesn't warn
|
|
|
|
| |
libbb: rename xgetcwd and xreadlink
|
| |
|
|
|
|
|
| |
syslogd, logread: add debugging code (disabled)
syslogs: drastically smaller bss; fix "-C n" behaviour
|
| |
|
|
|
|
| |
the busybox binary) into enums (which don't).
|
|
|
|
| |
definitions. (That should only be on prototypes.)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
#49: I found one memory overflow and memory leak in "ln" applet.
Last patch reduced also 54 bytes. ;)
#50: I found bug in loginutils/Makefile.in.
New patch have also new function to libbb and
aplied this to applets and other cosmetic changes.
|
|
|
|
|
|
| |
make xreadlink() return NULL on failure, and make sure everyone
uses the interface correctly.
-Erik
|