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

fs: set path when mkdir recursive called on file #31607

Closed
wants to merge 1 commit into from

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Feb 1, 2020

Similar fix to #31505, we should bail early if mkdir recursive is called on a file path.

Fixes: #28015

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

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Feb 1, 2020
@bcoe bcoe added the fast-track PRs that do not need to wait for 48 hours to land. label Feb 1, 2020
@bcoe
Copy link
Contributor Author

bcoe commented Feb 1, 2020

If folks are open to it, I would love to fast track this fix.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@@ -1398,7 +1400,6 @@ int MKDirpAsync(uv_loop_t* loop,
}
// verify that the path pointed to is actually a directory.
if (err == 0 && !S_ISDIR(req->statbuf.st_mode)) err = UV_EEXIST;
uv_fs_req_cleanup(req);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were calling uv_fs_req_cleanup prematurely on Windows systems, and freeing req->path.

uv_fs_req_cleanup is called in FSReqAfterScope::~FSReqAfterScope().

@nodejs-github-bot

This comment has been minimized.

@bcoe bcoe added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 2, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Feb 3, 2020

@bcoe
Copy link
Contributor Author

bcoe commented Feb 3, 2020

@richardlau mind if I land?

@richardlau
Copy link
Member

@richardlau mind if I land?

Go for it 😀.

bcoe added a commit that referenced this pull request Feb 3, 2020
PR-URL: #31607
Fixes: #28015
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@bcoe
Copy link
Contributor Author

bcoe commented Feb 3, 2020

Landed in 3f70d77

@bcoe bcoe closed this Feb 3, 2020
@bcoe bcoe deleted the fix-28015 branch February 3, 2020 22:33
codebytere pushed a commit that referenced this pull request Feb 17, 2020
PR-URL: #31607
Fixes: #28015
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@codebytere codebytere mentioned this pull request Feb 17, 2020
codebytere pushed a commit that referenced this pull request Mar 15, 2020
PR-URL: #31607
Fixes: #28015
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
PR-URL: #31607
Fixes: #28015
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@codebytere codebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 30, 2020
PR-URL: #31607
Fixes: #28015
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
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. c++ Issues and PRs that require attention from people who are familiar with C++. fast-track PRs that do not need to wait for 48 hours to land. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing error.path at fs.mkdir callback on last call
6 participants