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

Fix DirAccessWindows::make_dir() choking on ".." #66467

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

nikitalita
Copy link
Contributor

@nikitalita nikitalita commented Sep 26, 2022

CreateDirectoryW() chokes on absolute paths that contain "..". It returns an error 123: "The filename, directory name, or volume label syntax is incorrect."

Example: C:\\workspace\\..\\games\\assets

This causes DirAccessWindows::make_dir() to fail.
Simplifying the path before creating the dir fixes this.

`CreateDirectoryW()` chokes on absolute paths that contain `..`
example: "C:\\workspace\\..\\games\\assets"
Simplifying the path before creating the dir fixes this.
@nikitalita nikitalita requested a review from a team as a code owner September 26, 2022 19:25
@Calinou Calinou added this to the 4.0 milestone Sep 26, 2022
@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Sep 26, 2022
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

In case of make_dir, we are using \\?\ prefixed paths to avoid path length limitations, and automatic expansion is disabled for these, so part need to be absolute.

@akien-mga akien-mga merged commit ff8e240 into godotengine:master Sep 28, 2022
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.6.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 30, 2022
@timothyqiu
Copy link
Member

Cherry-picked for 3.5.2

@timothyqiu timothyqiu removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants