Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false negative with relative back path #9

Open
APerricone opened this issue Jun 25, 2020 · 1 comment
Open

false negative with relative back path #9

APerricone opened this issue Jun 25, 2020 · 1 comment

Comments

@APerricone
Copy link

Hello, I have a exception for file not found on a particular case:
I have fileName like '..\filename' and path like 'c:\folder1\folder2', the file 'c:\folder1\filename and the path c:\folder1\folder2 exist, but if I do

trueCase.trueCasePathSync('..\filename' ,'c:\folder1\folder2');

an exception is fired for file not found

@APerricone APerricone changed the title false positive with relative back path false negative with relative back path Jun 25, 2020
APerricone referenced this issue in APerricone/harbourCodeExtension Jun 25, 2020
@caseyWebb
Copy link

I'm not sure this is something we intend to support. Traversing up negates the "safety" added by the second argument as it will have to check that directory; removing the need to do that is the very intent of the second argument (it was introduced to support shared hosting).

Really, the second argument should be thought of less as a "base path" and more of a "known good" path. If there are no permission errors to worry about, trueCasePathSync(path.resolve('c:\folder1\folder2', '..\filename')) would be the preferred usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants