diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2021-02-26 23:51:15 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-03-01 09:23:43 +0000 |
commit | 7d0e7ba3c7029a5d744e04c8318d234de5ebedcf (patch) | |
tree | c13f465d49ba84d88080db54c5eedbc94a0676b1 /libbb | |
parent | b2ea5c74c8e2a26f9d9e8978d41a2368693e5ff7 (diff) | |
download | busybox-w32-7d0e7ba3c7029a5d744e04c8318d234de5ebedcf.tar.gz busybox-w32-7d0e7ba3c7029a5d744e04c8318d234de5ebedcf.tar.bz2 busybox-w32-7d0e7ba3c7029a5d744e04c8318d234de5ebedcf.zip |
win32(symlink): fix logic to determine the type of the symlink
On Windows, there are file symlinks and directory symlinks. When trying
to `opendir()` a symlink marked as `file`, it will fail. Even if the
target is a directory. Because it's the wrong symlink type.
To address this, our `symlink()` function calls `stat(target, ...)` to
see whether the target exists and is a directory.
The problem is that this `target` can be a relative path, and the link
path can _also_ be a relative path. Example: `symlink("dir", "uh/oh")`.
In this example, the target might say `dir`, but it is relative to
`uh/oh`, i.e. we need to `stat("uh/dir", ...)`.
This is necessary to pass the `cp` tests because they first create such
a directory symlink and then try to copy it while dereferencing
symlinks, i.e. calling `opendir()` on the symlink.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libbb')
0 files changed, 0 insertions, 0 deletions