-
Notifications
You must be signed in to change notification settings - Fork 824
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
Relax path safety (#5019) #5020
Conversation
@@ -196,6 +225,11 @@ impl From<Error> for super::Error { | |||
/// * Mutating a file through one or more symlinks will mutate the underlying file | |||
/// * Deleting a path that resolves to a symlink will only delete the symlink | |||
/// | |||
/// # Cross-Filesystem Copy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a change in this PR, but is something I felt worth documenting whilst I remembered
/// * Windows forbids certain ASCII characters, e.g. `<` or `|` | ||
/// * OS X forbids filenames containing `:` | ||
/// * Leading `-` are discouraged on Unix systems where they may be interpreted as CLI flags | ||
/// * Filesystems may have restrictions on the maximum path or path segment length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// * Filesystems may have restrictions on the maximum path or path segment length | |
/// * Stores (both filesystems and cloud providers) may have restrictions on the maximum path or path segment length |
This is actually a real issue I've ran into in a past project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I will add this to the docs on Path proper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds legit, small doc nitpick.
/// * OS X forbids filenames containing `:` | ||
/// * Leading `-` are discouraged on Unix systems where they may be interpreted as CLI flags | ||
/// * Filesystems may have restrictions on the maximum path or path segment length | ||
/// * Filesystem support for non-ASCII characters is inconsistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: what we could do for FS (although that wouldn't be backwards compatible) is to percent-encode the path segments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the challenge is knowing ahead of time what character are permitted. We don't want to be in something similar to the current situation because we assume that people won't create paths with weird characters
Which issue does this PR close?
Closes #5019
Rationale for this change
See ticket
What changes are included in this PR?
Are there any user-facing changes?