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

Disallow illegal characters / ? < > \ : * | " and so on in file and folder names #38614

Closed
hardviper opened this issue Jun 2, 2023 · 5 comments · Fixed by #40585
Closed

Disallow illegal characters / ? < > \ : * | " and so on in file and folder names #38614

hardviper opened this issue Jun 2, 2023 · 5 comments · Fixed by #40585
Labels
3. to review Waiting for reviews enhancement feature: filesystem hotspot: filename handling Filenames - invalid, portable, blacklisting, etc.

Comments

@hardviper
Copy link

Reopening issue that was closed by a bot.

Nextcloud allows characters in file and folder names that are illegal on some operating systems (windows).

Users in one of my installs use double quotes and colons. Nextcloud cannot open files or folder with symbols. Windows clients refuse to sync if there is a colon in the folder name.

My suggestion is to optionally not allow these special characters when creating files and folders in the web interface (or implement a setting where the administrator will specify an array of forbidden characters). Files and folders with these symbols in the sync folder must be renamed and the specified symbol removed before it can be distributed to other clients on different OSes.

@hardviper hardviper added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jun 2, 2023
@solracsf solracsf changed the title Disallow illegal characters / ? < > \ : * | " and so on in file and folder names Disallow illegal characters / ? < > \ : * | " and so on in file and folder names Jun 3, 2023
@theredkrawler
Copy link

Spaces after folders are becoming a common issue for us due to the prevalence of iPhones and autocorrect. Users will create a folder and the iPhone keyboard will helpfully add a space at the end which then breaks the sync on Windows desktops accessing the same directories.

The Nextcloud desktop client does pop up a notification about a certain directory containing an illegal character, but if you blink you miss it. It also only provides the first part of the directory tree in the notification which makes it hard to narrow down if you're being notified about something half a dozen directories deep.

Maybe an app that runs once a day/hour/whenever to convert illegal characters in to legal characters would be a solution? That way people with Windows clients can opt in.

@hardviper
Copy link
Author

Maybe an app that runs once a day/hour/whenever to convert illegal characters in to legal characters would be a solution? That way people with Windows clients can opt in.

@theredkrawler Thank you for responding! My problem is also related to the fact that I use external storage and cannot rename files.

@khoschi
Copy link

khoschi commented Aug 21, 2023

Reasons to change the behaviour of the webinterface, which allows to use restricted and illegal characters as file and folder names:

  • some people will use these characters without understanding the consequences. We had teachers try to use them for gernder-correct folder naming, blowing up their courses.
  • these characters may cause issues when scripts parse the nextcloud file folders.
    The algorithm will produce filesystem objects with two out of three escape characters, failing only when all three are used.

I would suggest to turn the active rewritng algorithm into an option. For updates enable it per default, for a new install disable it (and restrict the use). A scipt can be written to test and to change existing installations.

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 21, 2023
@skjnldsv skjnldsv added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Sep 22, 2023
@susnux
Copy link
Contributor

susnux commented Sep 26, 2023

I would vote for merge the characters from the constants and a system config like (\OCP\Constants::FILENAME_INVALID_CHARS).

@skjnldsv skjnldsv added invalid 3. to review Waiting for reviews and removed 2. developing Work in progress invalid labels Oct 4, 2023
@skjnldsv
Copy link
Member

skjnldsv commented Oct 4, 2023

PR in #40585

We do not support windows as a server. But we do agree that compatibility can be improved. So you will now have a dedicated config to allow you to customise the forbidden characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement feature: filesystem hotspot: filename handling Filenames - invalid, portable, blacklisting, etc.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants