nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 780 forks source link

[Bug]: Permission denied for the creation of a new file inside a read-only permission folder #6884

Open loulous24 opened 2 months ago

loulous24 commented 2 months ago

⚠️ Before submitting, please verify the following: ⚠️

Bug description

When someone with read-write permission of a folder create a new file inside it and I try to synchronise again the folder whereas I only have read permission, there is an error in the synchronisation "Permission denied".

Steps to reproduce

  1. User 1 creates a folder with read-write permissions for them and read-only permission for user 2.
  2. User 2 synchronises the folder.
  3. User 1 creates a file inside the folder.
  4. User 2 tries to synchronise the folder again a gets an error permission denied.

Expected behavior

The file is created inside the folder. The permissions are set correctly for the folder (read-only) and for the file (read-only too).

Which files are affected by this bug

All files created inside a read-only permission folder

Operating system

Linux

Which version of the operating system you are running.

Fedora Linux 39

Package

Appimage

Nextcloud Server version

29.0.2.2

Nextcloud Desktop Client version

3.13.1

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 3.4.2 to 3.4.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

No response

Additional info

I did not noticed this bug in #6796 which was happening when a read-only permission file was modified but is related to the way permission are managed by Nextcloud Desktop for Linux. The branch #6839 did not fix the problem (as it happens with version 3.13.1).

shilin-da commented 1 month ago

Same here with server 27.1.11, Default internal user-backend, and Arch Linux / Manjaro client packages. Versions 3.13.0-3.13.1 are broken.

Verison 3.12.3 is fine, downgraded to it.

abrain commented 1 month ago

Probably related: A sub-folder with files in an already synced read-only folder got deleted. The files are gone, but the folders cannot be deleted.

Windows 11, Nextcloud Client 3.13.2, Server 28.0.6

caguiar commented 1 month ago

We have the same problem as reported by abrain: On a groupfolder, a sub-folder with files in an already synced read-only folder gets deleted. The files are gone, but the folders cannot be deleted. The workaround is to manually delete the folders on the PCs, but this is not feasible when there are a few tens of users.

Windows 10 or 11, Nextcloud Server 29.0.3, Nextcloud Client 3.13.2

ElSi-DVT commented 1 month ago

Can confirm the error with following scenario:

  1. User 1 shares a folder with files inside to User 2 (only read permissions)
  2. The folder and files inside are getting synchronized to the computer of User 2.
  3. User 1 deletes the folder.
  4. The client on User 2's computer tries to delete the folder but fails. (the files are deleted successfully)
  5. User 2 can't move, delete, modify the folder or the parent folder.

The only way to get rid of the folder is that User 1 restores the deleted folder and changes the permissions of User 2 that writing is allowed too.

grafik

Here is some information

[General]
clientVersion=3.13.23.12-Win64 (build 20240708)
isVfsEnabled=false
overrideLocalDir=
overrideServerUrl=
showInExplorerNavigationPane=true
moveToTrash=false

The Server Version ist 28.0.8

camilasan commented 1 month ago

I have been able to reproduce the following with server 27.1.3, desktop client 3.13.2 on linux, groupfolder 15.3.8:

So the only actions that throws an error is delete. On Windows with desktop client 3.13.0, all file actions worked as expected.

  • User 1 shares a folder with files inside to User 2 (only read permissions)

  • The folder and files inside are getting synchronized to the computer of User 2.

  • User 1 deletes the folder.

  • The client on User 2's computer tries to delete the folder but fails. (the files are deleted successfully)

  • User 2 can't move, delete, modify the folder or the parent folder.

I could not reproduce any errors with this scenario (a simple shared folder).

camilasan commented 1 month ago

A sub-folder with files in an already synced read-only folder got deleted. The files are gone, but the folders cannot be deleted.

I also tried with sub folders on Linux and Windows. On Linux I got the same error as with files and in Windows it worked. It was with Windows 10. And I just had upgraded to 3.13.2 this time.

camilasan commented 1 month ago

I also try creating the files/folder in the web and via another client. The effect was the same: only Linux throws the 'permission denied' error.

Pia-Pi commented 4 weeks ago

Same here on my Kali-Linux... (Nextcloud Desktop-Client 3.13.2 on local EXT4-Filesystem) A workaround is to manually give the local user write access to the corresponding directory in the local file system. The sync client notices this directly and can now write the file to be synchronized. Immediately afterwards, however, the sync client automatically revokes its write permissions, so that subsequent synchronizations fail again.

TheRealTripleB commented 2 weeks ago

I have the same problem here in the company. MacOS with Nextcloud Client 3.13.2 We have several group folders in which only certain users are allowed to write. If something is changed in these folders, all other users get "Permission Denied" errors. Files that are in read-only group folders are created locally with -r--r--r--. If someone changes files, the Nextcloud client can no longer change the files.