Skip to content

fs: fix existsSync for invalid symlink at win32#30556

Closed
pd4d10 wants to merge 2 commits intomasterfrom
unknown repository
Closed

fs: fix existsSync for invalid symlink at win32#30556
pd4d10 wants to merge 2 commits intomasterfrom
unknown repository

Conversation

@pd4d10
Copy link
Contributor

@pd4d10 pd4d10 commented Nov 20, 2019

Fixes: #30538

Background

#18618 uses access instead of stat to implement fs.existsSync. Unfortunately, seems the two approaches both have some limitations at Windows:

Expected behavior of existsSync stat access
Invalid symlink false
File without privileges true

This PR adds a double check only at win32 platform to fix this issue.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.existSync returns true after fs. symlinkSync node 10 onwards in windows only

8 participants