-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🪟📁📄 Ability to enforce windows compatible file names on the server #44963
Comments
Subscribing myself, as I think this is then also a task for clients.
|
@tobiasKaminsky we need this implemented / fixed on the clients, server and WebUI are already done:
Implementation: Get the capability "forbidden_filename_characters" from the files app. This is an array of forbidden characters (could be multibyte characters, so it is an array of strings). If any of the strings in the array matches the filename it is considered invalid. |
Besides some characters not allowed on windows, there are more rules that need to be taken into account, e.g. a Filename is also not allowed to end with a dot or a space. There are also some reserved filenames. |
Yes but having the forbidden characters implemented in clients is a good first step and also allows to configure other compatibility (like with some filesystems that forbid just
This is also only partially true, Windows supports a lot of naming things, but the Explorer simply does not, like trailing But we probably should still enforce the character + the trailing space / dot rules. About the path length we can not do much, that depends on the users mount point and file type (e.g. for spreadsheets the table name counts into the path length 🤦). |
Maybe that is relevant? server/config/config.sample.php Lines 1972 to 1983 in 8c10c78
|
Not only it is not only specific characters but also files and casing, and that list for characters is not complete (missing e.g. char 1-31). |
You also can't have a space or a dot at the end of a folder name on Windows. |
pretty sure we trim the names on NC side 🤔 |
No, spaces are pretty valid on Mac and Linux. But we restrict even on Linux to not include ascii 0-31 (including tab). |
After discussion with @Altahrim and @come-nc we came to the conclusion the best is to keep the configuration generic but just provide a "preset" for windows.
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@AndyScherzinger @jancborchardt How do we handle this use case:
Now the behavior can be:
3 is probably very hard and requires work on internal filesystem -> 2 would be be from my point of view. |
Capabilities:
Webdav:
OCS:
@susnux checks if exception can be localised via http header I can provide a LTD with branch/app, so that we can all have the same state. |
@susnux I would say option (3). Why do you think it is hard? Wouldn't is just mean that while updating an existing file's content the checks simply won't be executed? So the checks would be on
|
IFilenameValidator
for all filename validation and remove other validation code
#46375
Status update:
|
How to use GitHub
Is your feature request related to a problem? Please describe.
In some scenarios with a large chunk of the user base being Windows users, using the Desktop client for example sync conflict can get created easily via the web interface, other clients or directly via any client software supporting WebDAV by creating files or folders that cannot be synced down to Windows ever.
Describe the solution you'd like
Add a setting to 'enforce windows compatible file names' on the server, so when the user tries to rename/create files/folders that would generate conflict when syncing, the server would prevent the action. This setting should be optional and needs to be turned on explicitly.
Also there is no logic expected to migrate existing data, just to prevent it from the moment on the setting is active.
Describe alternatives you've considered
None, given the fact that the person creating a file/folder might not be the one being affected by it and the affected person might not have the permissions on the system to change the names, i.e. when shared read-only.
The text was updated successfully, but these errors were encountered: