Skip to content

Set folders writable if remote perms require it, recurse into subdirs if etag and remoteperms differ #9637

Merged
nilsding merged 4 commits intomasterfrom
bugfix/noid/perms
Mar 18, 2026
Merged

Set folders writable if remote perms require it, recurse into subdirs if etag and remoteperms differ #9637
nilsding merged 4 commits intomasterfrom
bugfix/noid/perms

Conversation

@nilsding
Copy link
Member

Certain remote permissions (CanWrite/CanDelete/CanRename/CanMove) allow contents of a certain folder to be changed. Setting those folders read-only just because the CanAddSubDirectories/CanAddFile permission seems to be the wrong thing to do.

I'm still not sure if serverEntry.remotePerm != dbEntry._remotePerm was intentional, or if it's even necessary to check for that as well; the etag should change if permissions were changed, but this seems to not always be the case (e.g. due to a fixed bug in a storage app).

@nilsding nilsding self-assigned this Mar 17, 2026
@nilsding nilsding added this to the 33.0.0 milestone Mar 17, 2026
@nilsding
Copy link
Member Author

/backport to stable-33.0

@nilsding
Copy link
Member Author

/backport to stable-4.0

Copy link
Collaborator

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan of recursing inside folders if the only change is a permission change without etag changes
unsure what are the side effects of that
that said, if no automated tests complain, you still get the approval
previous behavior should have been covered by tests

@nilsding nilsding enabled auto-merge March 18, 2026 10:14
…ssions

Some of these should not mark the folder as read-only.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
…odifiable permissions present

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
subfolders should also be updated

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
I'm still not sure if `serverEntry.remotePerm != dbEntry._remotePerm`
was intentional, or if it's even necessary to check for that as well.

The etag should change if permissions were changed, but this is not
always the case (e.g. due to a fixed bug in a storage app).

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
@nilsding nilsding force-pushed the bugfix/noid/perms branch from 6752ce8 to 2648a47 Compare March 18, 2026 10:15
@github-actions
Copy link

Artifact containing the AppImage: nextcloud-appimage-pr-9637.zip

Digest: sha256:cf09b527fc6a9821f5a88d71e2b824a868ee20c402af38205a20de512dea62fb

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)
109 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows NextCloud client v4.x - local NTFS rights on shared folder trouble

2 participants