Navigation Menu

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

Commit

Permalink
windows: don't inhibit reparse behavior when non-symlink is encountered
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
piscisaureus committed Jun 28, 2012
1 parent 1b68434 commit 4a88b3b
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 146 deletions.
2 changes: 2 additions & 0 deletions src/win/error.c
Expand Up @@ -83,6 +83,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_SIGNAL_REFUSED: return UV_EIO;
case ERROR_FILE_NOT_FOUND: return UV_ENOENT;
case ERROR_INVALID_NAME: return UV_ENOENT;
case ERROR_INVALID_REPARSE_DATA: return UV_ENOENT;
case ERROR_MOD_NOT_FOUND: return UV_ENOENT;
case ERROR_PATH_NOT_FOUND: return UV_ENOENT;
case ERROR_ACCESS_DENIED: return UV_EPERM;
Expand Down Expand Up @@ -111,6 +112,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_OPERATION_ABORTED: return UV_EINTR;
case WSAEINTR: return UV_EINTR;
case ERROR_INVALID_DATA: return UV_EINVAL;
case ERROR_SYMLINK_NOT_SUPPORTED: return UV_EINVAL;
case WSAEINVAL: return UV_EINVAL;
case ERROR_CANT_RESOLVE_FILENAME: return UV_ELOOP;
case ERROR_TOO_MANY_OPEN_FILES: return UV_EMFILE;
Expand Down

1 comment on commit 4a88b3b

@piscisaureus
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnoordhuis said: lmg

Please sign in to comment.