Skip to content

Users cannot delete files from shared/ even with delete permission #16599

Closed

Description

@mattrandallbecker

Steps to reproduce

  1. Share folder with group/user, giving delete permissions
  2. Navigate to file in folder attempt to delete

Expected behaviour

File should be deleted

Actual behaviour

Error message "Could not delete: filename"
Activity Log still shows that the person deleted the file, but the file remains.
I added some debugging lines to delete.php and it fails on the unlink() call on line 31.
The admin account can delete the file just fine, only the user gets the error message.
The user can delete any of their own files, the only problem files are under Shared/

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache

Database: MariaDB

PHP version: 5.5.9

ownCloud version: 8.0.3

Updated from an older ownCloud or fresh install: Updated from 6.x->7.x->8.0->8.0.3

List of activated apps: Activity, Deleted Files, First Run Wizard, PDF Viewer, Share Files, Updater, Versions, Video Viewer

Are you using external storage, if yes which one: No

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Chrome/Internet Explorer

Operating system: Windows 7

Logs

Web server error log

No lines are added to the log when trying to delete

ownCloud log (data/owncloud.log)

No lines are added to the log when trying to delete

Screenshots

picture1

picture3

Activity

  1. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    Hmm strange.

    If the permissions were wrong, the UI would not show the trash icon but it does here.

    Can you confirm that you had "loglevel" set to 0 when checking the logs ?

    I see you have encryption enabled: usually when deleting a file it will first delete the file and then delete the keys. So maybe the file deletion worked but something wrong happened during key deletion.

  2. mattrandallbecker commented on May 28, 2015

    @mattrandallbecker
    Author

    Just confirmed loglevel = 0, still no log entries written when it fails. In double checking looks like I'm not using encryption, sorry for the mistake there.

    Again from my testing the line that fails is as follows app/files/ajax/delete.php

    \OC\Files\Filesystem::unlink($dir . '/' . $file)

    I'm not familiar enough with the owncloud source to determine which unlink it was using so that's as far as I got with my troubleshooting.

  3. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    When you say "fails", do you mean it throws an exception or does it just return false ?
    Are you able to debug inside ?

    Does it happen for newly created shares or only old ones, maybe from a former upgrade ?

  4. mattrandallbecker commented on May 28, 2015

    @mattrandallbecker
    Author

    It just returns false, I'm not able to debug unlink()

    Also I had only been trying with old folders that existed before the upgrade from 7->8. It turns out file deletion works if I create a new folder, new file, then share the folder and delete.

    The delete only fails if the folder existed before the upgrade, even if the file is new after the upgrade.

    Screenshot of the working process
    success

  5. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    Okay, that's an important clue.

    If you had 7.0.2 at the time the shares were created, you might be having this issue: #13361

    There is unfortunately no proper migration path to fix it, so you might want to simply unshare then reshare the folder.

  6. mattrandallbecker commented on May 28, 2015

    @mattrandallbecker
    Author

    Ok, I figured it out and after changing everything possible and the solution is a bit strange, likely a bug?

    So even if I remove all groups for a user, remove all sharing for a folder, then re-add groups, and re-add sharing it still would not allow users to delete shared files.

    It seems this was because all users have a quota set of 0. Once I increase the quota for a user to 1GB they are able to delete files out of the shared directories. This certainly was not the behavior in versions 6/7 as we have always maintained 0 quota for all employees and they work out of shared exclusively.

  7. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    Weird.

    But you said for new folders it worked ? Or did you test new shares with users that did not have 0 as quota ?

  8. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    The quota issue sounds like #16187

  9. mattrandallbecker commented on May 28, 2015

    @mattrandallbecker
    Author

    Yes it's exactly that issue.

    Pretty much 100% what we are experiencing.

  10. PVince81 commented on May 28, 2015

    @PVince81
    Contributor

    Ok thanks, closing as duplicate.
    Please follow up in the linked ticket.

  11. locked as resolved and limited conversation to collaborators on Aug 11, 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