Skip to content
This repository was archived by the owner on May 4, 2018. It is now read-only.

Commit 4a88b3b

Browse files
committed
windows: don't inhibit reparse behavior when non-symlink is encountered
This fixes the issue that a mount point would be treated as a symlink, but readlink would subsequently return an NT namespaced path that is unusable for many purposes. This also pre-emptively fixes the problems that would arise when an user has a reparse point whose tag is neither IO_REPARSE_TAG_MOUNT_POINT nor IO_REPARSE_TAG_SYMLINK. Finally uv_lstat() will now return the correct length in st_size. Previously the length was computed incorrectly for relative symlinks, and those that had non-ascii characters in their target.
1 parent 1b68434 commit 4a88b3b

File tree

2 files changed

+168
-146
lines changed

2 files changed

+168
-146
lines changed

src/win/error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
8383
case ERROR_SIGNAL_REFUSED: return UV_EIO;
8484
case ERROR_FILE_NOT_FOUND: return UV_ENOENT;
8585
case ERROR_INVALID_NAME: return UV_ENOENT;
86+
case ERROR_INVALID_REPARSE_DATA: return UV_ENOENT;
8687
case ERROR_MOD_NOT_FOUND: return UV_ENOENT;
8788
case ERROR_PATH_NOT_FOUND: return UV_ENOENT;
8889
case ERROR_ACCESS_DENIED: return UV_EPERM;
@@ -111,6 +112,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
111112
case ERROR_OPERATION_ABORTED: return UV_EINTR;
112113
case WSAEINTR: return UV_EINTR;
113114
case ERROR_INVALID_DATA: return UV_EINVAL;
115+
case ERROR_SYMLINK_NOT_SUPPORTED: return UV_EINVAL;
114116
case WSAEINVAL: return UV_EINVAL;
115117
case ERROR_CANT_RESOLVE_FILENAME: return UV_ELOOP;
116118
case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE;

0 commit comments

Comments
 (0)