-
Notifications
You must be signed in to change notification settings - Fork 19
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
Platform-agnostic "valid file name"? #93
Comments
I assume the issue here is the "path separator [] on the underlying filesystem". It's problematic for this allowed filenames to depend on the platform; if we want to block \ on windows, we should block it everywhere - for OPFS. Of course, you can have real files with \ in a Linux/Mac FS IIRC... which shouldn't matter for OPFS. It does matter for non-OPFS uses, which I imagine is why it's written this way. However, I think for OPFS it should be unified and block . I don't know how easy it is for there to be differences between OPFS and non-OPFS uses (which we do/will not support in any case). |
Yeah, I would prefer avoiding platform-specific behavior if we can, and it seems doable here. |
Yeah I agree the we should be more specific about the restrictions for the OPFS, and they should probably be more lax than the restrictions we have for local files. This is one of the big reasons I'm proposing not to allow It seems to me we have two options:
I'm okay with either option, though if all user agents are storing this mapping anyways then I think option 2 makes more sense (and the OPFS doesn't have to change if the underlying platforms do) We'll need some way to add further restrictions for non-OPFS files. Perhaps we could do something like what we do for permissions, i.e. "run this check" is an algorithm that can be set depending on how the handle is acquired? See WICG/file-system-access#399 (and please let me know if there's a different approach you recommend in that case or this one) |
Looking at this again, there's two distinct conversations about allowed characters:
For the former I think you're probably right that we should block both I was mostly talking about the latter in my comment above. We could adopt something like https://www.w3.org/TR/international-specs/#file_naming to ensure files could be stored as-is on the underlying platform (option 1 above), or not (option 2 above)... I know I'd suggested option 2 above, but looking at this again, it seems like it would be nice to be consistent with other parts of the platform and just use https://www.w3.org/TR/international-specs/#file_naming. Thoughts? |
Do we actually know of a web platform feature that enforces https://www.w3.org/TR/international-specs/#file_naming? That document is not a normative document so is not suitable for reference. E.g., https://w3c.github.io/FileAPI/#dfn-file only prohibits lone surrogates. |
According to https://wicg.github.io/entries-api/#names-paths:
|
Thanks @szewai! Coupled with it using USVString that's probably a more reasonable starting point. |
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676}
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676}
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676}
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676}
…tFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755
…tFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755
…tFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <dsleechromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755 UltraBlame original commit: 364abd441d742e0bc35abe26540b3d46125d8752
…tFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <dsleechromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755 UltraBlame original commit: 364abd441d742e0bc35abe26540b3d46125d8752
…tFS, a=testonly Automatic update from web-platform-tests FSA: Relax file name checks in the BucketFS Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <dsleechromium.org> Commit-Queue: Austin Sullivan <asullychromium.org> Cr-Commit-Position: refs/heads/main{#1206676} -- wpt-commits: e4c1bdf27a01716a605a70e171be797f560952bf wpt-pr: 39755 UltraBlame original commit: 364abd441d742e0bc35abe26540b3d46125d8752
Unlike when saving files to the local file system, the names of files in the the Bucket File System (a.k.a. OPFS) are obfuscated before they end up on disk - if they even end up on disk at all. As such, we don't need to perform the same name sanitization and obfuscation for these files as we do for files that end up on the user-visible file system. See whatwg/fs#93 for context Bug: 1399536 Change-Id: I019b393b731cd20aa4c45eade4eca19b6633e9cd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4492076 Reviewed-by: Daseul Lee <[email protected]> Commit-Queue: Austin Sullivan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1206676}
https://fs.spec.whatwg.org/#valid-file-name seems rather bad, especially for just OPFS.
cc @whatwg/fs
The text was updated successfully, but these errors were encountered: