Repository navigation
Closed
Description
Steps to reproduce
- Setup v8.2.1 with "root" as the admin
- Create two users "user1" and "user2"
- Add "root", "user1" and "user2" into a new group "users"
- Login as "root"
- Create a folder "common/sub"
- Share "common" with "users"
- Login as "user1"
- Create a non-empty text file "test.txt" with some contents using the text editor
- Share "test.txt" with "user2"
- Login as "user2"
- Check that the file is there
- Login as "user1" again
- In the web UI, move "test.txt" into "common"
- Then move "test.txt" into "common/sub"
- View the text file: contents still exist
- Check the database entry for test.txt
- Login as "user2"
- Check the database entry for test.txt
- View or download the received file share still in the root "/test.txt"
Expected result
File can be downloaded and synced.
Actual result
File is broken and empty when opened as receiver.
Before the last login as "user2" the etag still exists in the database.
As soon as "user2" logs in, the etag becomes NULL:
MariaDB [owncloud]> select * from oc_filecache where path like '%test%';
+--------+---------+---------------------------+----------------------------------+--------+----------+----------+----------+------+------------+---------------+-----------+------------------+------+-------------+
| fileid | storage | path | path_hash | parent | name | mimetype | mimepart | size | mtime | storage_mtime | encrypted | unencrypted_size | etag | permissions |
+--------+---------+---------------------------+----------------------------------+--------+----------+----------+----------+------+------------+---------------+-----------+------------------+------+-------------+
| 19 | 1 | files/common/sub/test.txt | 9fa03663cc736121e08e4f487f0d3bec | 10 | test.txt | 7 | 7 | 0 | 1448556624 | 1448556624 | 0 | 0 | NULL | 23 |
+--------+---------+---------------------------+----------------------------------+--------+----------+----------+----------+------+------------+---------------+-----------+------------------+------+-------------+
This might be triggered by the share grouping logic ?
Also note that if instead of "common/sub" you only use "common", the etag stays intact but the file is still broken, and after a few file manipulations the etag becomes NULL too.
And, if as "user2" you move "test.txt" in a local non-shared subfolder, POOF the file vanishes!
Versions
Observed in v8.2.0 and v8.2.1
@rullzer @schiesbn
Activity
PVince81 commentedon Nov 26, 2015
Also observed on master 60682e1
PVince81 commentedon Nov 26, 2015
On 8.1.4 the same steps also result in an empty file, but the etag was not set to null (might be luck though)
PVince81 commentedon Nov 26, 2015
In 8.0.9 the file does NOT appear at all in the root of "user2", the received share is correctly merged (share merge) together and "user2" only sees the merged file inside "common/sub".
So we could say this is a regression from OC 8.
PVince81 commentedon Nov 26, 2015
@cmonteroluque FYI
PVince81 commentedon Nov 27, 2015
Also looks like it removed the delete permission. It almost looks like if it share fileinfo entry got mixed up with the actual fileinfo entry.
PVince81 commentedon Nov 27, 2015
Apparently it seems to break the versions too 😦 (the files are 0 bytes too)
rullzer commentedon Dec 1, 2015
So it seems the file is not destroyed on disk... (which is at least something)
rullzer commentedon Dec 1, 2015
Ok I got it. This happens for the following reason I think:
At step 11 user1 transfers ownership of the file to the user root.
This means that at that point the share user1 has with user2 is effectively a reshare. And if I update the database right before point 15 everything works out.
So we need to update the parent of the file.
rullzer commentedon Dec 1, 2015
We might be able to set the parent correctly when we listen for the rename hook....
rullzer commentedon Dec 1, 2015
But.... do we actually want to allow this. If you hava a file commong/foo.txt and you try to share that with user2 we do not allow it.
We could also say we do not allow moving of shared files into received shares.
13 remaining items
Update parent when moving share into recieved share
Update parent when moving share into recieved share
Update parent when moving share into recieved share
brozkeff commentedon Dec 21, 2015
I performed exactly the test as PVince81 outlined in Steps to reproduce at the beginning on a cloned production VPS where I upgraded owncloud from 7 (production version) gradually to 8, 8.1, 8.2.1 and then switched repository to 8.2 testing and upgraded via sudo apt-get update && sudo apt-get install owncloud to 8.2.2~RC1-24.1
After logging as user2 I see the text file twice:
The contents of the file is OK, and the fact the file is visible twice makes some sense, because the file is shared indirectly via root to whole group (sharing common/sub inclucing everything inside even things user1 moved there at some point), and directly via user1 by manually sharing that particular file to user2. But there is a slight mismatch between the name of the owner of the containing folder written next to the icon, and the info in Sharing and Activity section to that file.
Screenshot:
http://i63.tinypic.com/2i8yziw.png
After all the steps database query looks like this:
PVince81 commentedon Dec 21, 2015
@brozkeff in your screenshot you ask "shouldn't it be the same ?".
I think the activity app will not be notified of the special manipulation that was done internally, so the activity you see here might still be the old one. I'm not sure whether this is fixable. Maybe a new activity should be created after the reparenting operation, if possible ? (something for a separate ticket though)
CC @nickvergessen
nickvergessen commentedon Jan 4, 2016
If you think there is an issue with the activity, please create a separate issue. But yes, moving files does not retroactivly update all paths in activities
lock commentedon Aug 7, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.