nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.12k stars 4.03k forks source link

Shared files are duplicated when moved to subdir #8301

Closed pawlosck closed 6 years ago

pawlosck commented 6 years ago

Steps to reproduce

  1. Create empty file (e.g testowy.txt) in root dir and enter some text

  2. Share this file with group (I added group "users" - all users are members of this group)

  3. Create empty dir (e.g "Katalog testowy") in root dir

  4. Move shared file (testowy.txt) to dir "Katalog testowy". You have to be logged in as owner this file and dir

  5. File is still visible in root dir for other users. "Katalog testowy" is not visible for other users. Expected: I think, subdir should be visible for others users, but files inside dir not, if are not shared.

  6. Share dir "Katalog testowy" with other users Expected: Subdir should be visible for other users when shared (OK) Shared file should be visible only in "Katalog testowy". At the moment, file is visible in subdir (Katalog testowy) only for owner. Other users can see this file in root dir and subdir. When modify this file in root dir (non owner "File" app), file in subdir is modified too.

  7. Create and share file inside subdir as owner. File is visible for owner and other users in subdir

Server configuration

Operating system: Debian9 Web server: Apache 2.4.25 Database: sqlite 3.16.2 PHP version: 5.6.30 Nextcloud version: (see Nextcloud admin page): NextCloud 13 (stable) Updated from an older Nextcloud/ownCloud or fresh install: fresh instalation

Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

List of activated apps: Enabled:

Are you using external storage, if yes which one: local/smb/sftp/... No

Are you using encryption: yes/no No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... No

Client configuration

Browser: Firefox 58.0.2 (64 bity)

Operating system: Kubuntu

tflidd commented 6 years ago

File is still visible in root dir for other users. "Katalog testowy" is not visible for other users. Expected: I think, subdir should be visible for others users, but files inside dir not, if are not shared.

By default, a user only sees the folder or file shared with him. The above structure is not shown! So a single file is always shown directly without the folder containing it. In your case you'd unshare the fiile and then share the folder Katalog testowy with the group (if the users use the NC client, it will delete the folder from their sync folder and download the new shared folder).

pawlosck commented 6 years ago

Ok, I understand logic this case, but should be option to auto share directory structure, when user share file.

For me, bigger problem is that, when owner move shared file to subdir other people sees two files. Most of people will be think that these files are not the same file. I modified one file and file in subdir was modified too. What if it will be important file. User lost data, because will be think that is different file. It should be fixed.

tflidd commented 6 years ago

Imagine we avoid the same file to be shared with you twice. It can still happen, that there is a overlap between shares (especially with resharing, server-to-server-sharing etc.). If someone already share a file with you, and someone different wants to share a folder that contains the same file, what do you want to happen (the sharing is not possible, only the file is missing, what if the permissions are different-> e.g. in general you can only read a folder and a specific file is shared with editing permission)?

MorrisJobke commented 6 years ago

Imagine we avoid the same file to be shared with you twice. It can still happen, that there is a overlap between shares (especially with resharing, server-to-server-sharing etc.). If someone already share a file with you, and someone different wants to share a folder that contains the same file, what do you want to happen (the sharing is not possible, only the file is missing, what if the permissions are different-> e.g. in general you can only read a folder and a specific file is shared with editing permission)?

Current behavior makes sense and we will keep it like that for now.

Thanks for the report anyways.