<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/libbb/xreadlink.c, branch cron_changes</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=cron_changes</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=cron_changes'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2023-08-21T11:46:52+00:00</updated>
<entry>
<title>win32: replace readlink(2)</title>
<updated>2023-08-21T11:46:52+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-08-21T11:36:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=9a80d9752d5d1867c0730c1f5bca12abd994907e'/>
<id>urn:sha1:9a80d9752d5d1867c0730c1f5bca12abd994907e</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>realpath: improved support for Windows paths</title>
<updated>2021-10-13T15:44:45+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-13T15:22:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4daf57b4fdc80422d6448c0a7914699fdedb95b8'/>
<id>urn:sha1:4daf57b4fdc80422d6448c0a7914699fdedb95b8</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2021-10-13T13:37:51+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-13T13:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0ecf1aea459571b48dc68ddc2b7b9265740fa960'/>
<id>urn:sha1:0ecf1aea459571b48dc68ddc2b7b9265740fa960</id>
<content type='text'>
</content>
</entry>
<entry>
<title>win32: rename is_absolute_path()</title>
<updated>2021-10-12T12:43:15+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-12T12:43:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b4b2b2c4fbba12561c5e988177bef699be306b26'/>
<id>urn:sha1:b4b2b2c4fbba12561c5e988177bef699be306b26</id>
<content type='text'>
As the comment pointed out is_absolute_path() was misnamed.  Rename
it to is_relative_path() and change the sense of all tests.
</content>
</entry>
<entry>
<title>libbb: better coreutils compatibility for realpath</title>
<updated>2021-10-08T23:47:12+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-07-31T12:51:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=94eb1c4dc6556932e1a12a0ce7734512ac95985e'/>
<id>urn:sha1:94eb1c4dc6556932e1a12a0ce7734512ac95985e</id>
<content type='text'>
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 &lt;rmy@pobox.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>win32: better handling of nested symlinks</title>
<updated>2021-08-12T10:49:56+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-08-12T10:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=da7efea0e7520f7ce8627acc9f4037a2f875c47e'/>
<id>urn:sha1:da7efea0e7520f7ce8627acc9f4037a2f875c47e</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>libbb: fix detection of relative paths in xreadlink.c</title>
<updated>2021-03-01T09:37:50+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-03-01T09:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b5cd41cdf4e6afd475fe34b755f99578e20b08ca'/>
<id>urn:sha1:b5cd41cdf4e6afd475fe34b755f99578e20b08ca</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Fix `xmalloc_readlink()` again</title>
<updated>2021-03-01T09:31:21+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-03-01T09:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3c44f5cae158ff4ffd03a4c319777ae88a60bcb9'/>
<id>urn:sha1:3c44f5cae158ff4ffd03a4c319777ae88a60bcb9</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>win32: make readlink(2) implementation unconditional</title>
<updated>2021-02-12T14:02:28+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-02-12T14:02:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e86a3ddd8b60eb0720874f5b9679446d12a1ac41'/>
<id>urn:sha1:e86a3ddd8b60eb0720874f5b9679446d12a1ac41</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2019-08-16T08:45:21+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2019-08-16T08:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=517cf74f6265ec4308b790b637b3f9778cbdc6e0'/>
<id>urn:sha1:517cf74f6265ec4308b790b637b3f9778cbdc6e0</id>
<content type='text'>
</content>
</entry>
</feed>
