-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fixed an ACL bug which disallowed renaming of files in certain configurations #2792
Conversation
There is a test by @icewind1991 which seems to expect rename to fail in this case. @icewind1991 Can you review the test and the PR? |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
@icewind1991 Kindly bumping this one :) |
Nextcloud generally requires write permissions on the parent folder for renames, mirroring the way the permissions work on linux. Only checking the file could be used to bypass "deny delete" permissions on a folder by moving files outside of the folder before deleting them. One possible improvement here would be to not require delete permissions (but still require write) on the parent folder if the file is just being renamed, not moved (so target parent and source parent are the same) |
Well I thought that the rename operation is somewhat equivalent to deleting the file and recreating it. But I think that your proposed implementation would certainly be better. |
@icewind1991 Could you take a look at my changes? I've tested it locally and it seems to work without issues. |
approach looks good 👍 |
@x7airworker Some commits are missing the sign-off, can you sign them off or squash them and force push again to fix the DCO ci step? |
Signed-off-by: Jake Esser <[email protected]> Replaced delete permission check with parent comparison Use strict comparison Fixed formatting issue Signed-off-by: Jake Esser <[email protected]> Formatted code
@come-nc Done. |
Steps to reproduce the issue
The file created in step 4 can now be deleted and recreated, but not renamed because the delete permission is missing in the parent folder.
The fix I propose checks the element itself or the parent for the required permission. Please let me know if there is a better way or this is a security risk.