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

feat: Add forbidden_filename_basenames config option #46545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jul 15, 2024

Summary

This allows to configure forbidden filenames (the full filename like .htaccess) and also forbidden basenames like com0 where com0, com0.txt and com0.tar.gz will match. We need this as only using basenames was too restrictive and will cause problems on some systems when updating.

Checklist

This allows to configure forbidden filenames (the full filename like `.htaccess`)
and also forbidden basenames like `com0` where `com0`, `com0.txt` and `com0.tar.gz` will match.
We need this as only using basenames was too restrictive and will cause problems on some systems when updating.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/bring-back-forbidden-names branch from 6b0cc80 to bdbeaba Compare July 15, 2024 17:39
@susnux susnux added enhancement 3. to review Waiting for reviews labels Jul 15, 2024
@susnux susnux added this to the Nextcloud 30 milestone Jul 15, 2024
@solracsf
Copy link
Member

'forbidden_filename_basenames' => ['archive'],

This will also block Archive.2024.tar.gz

If the function remains as-is, where first dot defines the basename, this needs perhaps a better documentation (a warning ⚠️ ) about this behaviour so admin fully understand the risk. Or a refactor 😄

@susnux
Copy link
Contributor Author

susnux commented Jul 15, 2024

This will also block Archive.2024.tar.gz

Yes this is exactly what it should do, it is only for filtering basenames. Needed for Windows support as on Windows com0 and com0.tar.gz are both the same invalid filename (see windows namespaces).

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants