Skip to content

user able to delete shared file when mounted using webdav #2484

Closed

Description

@danobrie

UPDATE with more info:

USER1 shares somefolder/ containing somefile (created using "New: text file) with USER2, checks "can edit" unchecks "delete".
USER2 maps network drive via webdav and deletes somefile in M:\Shared\somefolder\
somfile is deleted from USER1 interface, is in USER2's trash bin.

Expected behaviour

File should be unshared with USER2
Note, if USER1 shares only the file and USER2 deletes, it correctly results in unsharing the file.

Actual behaviour

File is made unaware to owncloud in USER1's web interface (it is still there on the server but does not show up on web interface). File is now in USER2's trash and USER2 can restore it. I have had SOME luck with the correct behavior when somefile.txt includes the .txt file extension, but this does not guarantee correct behavior.

If USER1 creates a New text file (somefile2) in his root this sometimes results in the deleted file reappearing in somefolder.

SOMETIMES when I've done this somefile.txt COMES BACK on its own after a couple minutes and reappears in the mapped drive of USER2 and in the web interface of USER1. But ~90% of the time it never comes back.

The file is still in the USER1's file directory on the server no matter if it comes back or not.

Steps to reproduce

  1. Create USER1 and and USER2
  2. USER1 creates /somefolder/somefile.txt
  3. USER1 shares /somefolder with USER2. Check "can edit" uncheck "delete"
  4. USER2 uses NetDrive1.3.4.0 and maps drive via webdav https link
  5. USER2 deletes M:\Shared\somefolder\somefile.txt
  6. USER1 web interface shows somefile.txt is gone. Nothing in the Trash.
  7. USER2 sees in web interface the deleted file in trash and can restore it (but for step 8 does not restore it)
  8. USER1 creates New text file in root, somefile2. Looks in somefolder and somefile is back (or not).

Server configuration

Operating system:
Server is on Debian 6.0, Client is on Windows 7 64bit
Web server:
Apache2.2
Database:
MySQL5.1
PHP version:
5.3.3
ownCloud version:
5.0

Activity

  1. BernhardPosselt commented on Mar 21, 2013

    @BernhardPosselt
    Contributor
  2. icewind1991 commented on Mar 21, 2013

    @icewind1991
    Contributor

    Can't reproduce, after deleting the shared file over webdav it still exists for the original owner and it's correctly unshared

  3. danobrie commented on Mar 21, 2013

    @danobrie
    Author

    I thought I had found the problem, but it did not fix this. I had

    GRANT ALL PRIVILEGES ON oc-database.* TO 'toplevelocuser'@'localhost' WITH GRANT OPTION;

    where it needs to be set ON mysql.* as well to allow access to the mysql db to create users, correct? For now I have it set to ON . I thought I was introducing an additional level of security since I have other db's on mysql. What is the minimal GRANT that needs to be set? BTW, there was never a warning when I installed oc and did the initial setup through the web interface.

    I did a complete reinstall of owncloud, DROP oc-database, reinitiallized oc through the web interface and ran through this procedure again but still, USER2 deletes somefile in the shared somefolder in the mapped network drive and USER1 loses contact with the file but it still resides on the server.

    One interesting observation is that I see in mysql users that only the initial administrator account created in oc is getting an oc_admin account on mysql, none of the subsequent users I create get an oc_ name in mysql. Is this a change from oc 4.x to 5.0?

    UPDATE:

    I had defined somefile without the .txt extension. I did a complete reinstall of mysql and owncloud and followed again the above procedure but added the .txt extension to the file. When USER2 deleted somefile.txt, somefolder was no longer shared and all was well. Then, I create somefile WITHOUT the .txt, reshared somefolder with USER2 and now I again see the behavior I described in my original post.

  4. danobrie commented on Mar 21, 2013

    @danobrie
    Author

    Not sure if owncloud's log would help.

    Error files_sharing File source not found for: /somefolder March 21, 2013 13:54
    Warning search_lucene failed to extract meta information for /somefolder/somefile: unable to determine file format March 21, 2013 13:54
    Warning PHP readdir() expects parameter 1 to be resource, boolean given at /var/www/owncloud/lib/cache/file.php#88 March 21, 2013 13:53
    Warning PHP opendir(/srv/oc_data/Dan/cache/): failed to open dir: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#40 March 21, 2013 13:53
    Warning search_lucene failed to extract meta information for /somefolder: Could not open "/srv/oc_data/Keith/files/somefolder" (does not exist, or is not a file) March 21, 2013 13:53
    Warning search_lucene failed to extract meta information for /somefolder: Could not open "/srv/oc_data/Keith/files/somefolder" (does not exist, or is not a file) March 21, 2013 13:53
    Warning PHP readdir() expects parameter 1 to be resource, boolean given at /var/www/owncloud/lib/cache/file.php#88 March 21, 2013 13:53
    Warning PHP opendir(/srv/oc_data/Keith/cache/): failed to open dir: No such file or directory at /var/www/owncloud/lib/files/storage/local.php#40 March 21, 2013 13:53

    I should add that "Keith" is my USER1, he's the one that shares the folder.

  5. MTGap commented on Apr 7, 2013

    @MTGap
    Contributor

    The file isn't actually deleted, just removed from the cache. See #2765

  6. added a commit that references this issue on Apr 13, 2013
    4f6f645
  7. locked as resolved and limited conversation to collaborators on Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions