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

Properly sanitize Windows reserved names in evaluator paths #2964

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

lefou
Copy link
Member

@lefou lefou commented Jan 10, 2024

In case a segment path matches one of the reserved name of the Windows filesystem namespace, we insert a ~ directly after the offending segment part.

Here is a excerpt from an official Win32 documentation:

  • Do not use the following reserved names for the name of a file:

CON, PRN, AUX, NUL, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM¹, COM², COM³, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT¹, LPT², and LPT³. Also avoid these names followed immediately by an extension; for example, NUL.txt and NUL.tar.gz are both equivalent to NUL. For more information, see Namespaces.

We do the insertions on all platforms, not only Windows, for consistency of the out/ folder.

Fix #2961

@lefou lefou marked this pull request as ready for review January 10, 2024 17:01
@lefou lefou requested a review from lihaoyi January 10, 2024 17:04
@lefou lefou merged commit 323511b into main Jan 22, 2024
38 checks passed
@lefou lefou deleted the reserved-names branch January 22, 2024 14:35
@lefou lefou added this to the 0.11.7 milestone Jan 22, 2024
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

Successfully merging this pull request may close these issues.

Dealing with reserved file names under MS Windows
1 participant