Skip to content

Improve trashing files from bind mounts and network mounts

Ahmad Samir requested to merge work/ahmad/trash-bind-mounts into master
  • For bind mounts, the code already created topdir/.Trash-uid, but didn't use it, now it'll use that for trashed files

  • For network mounts, switch to using KMountPoint instead of Solid, and use the device ID (major, minor) for network mounts too, I think this is more robust. Only smb and nfs mounts are handled (matching what Solid was doing)

  • Split out some OSX-specific code to a separate method, to make the code more readable

  • Only check the sticky bit of the rootTrashDir:

    • the access() system call isn't that secure (it should be avoided, according to its manual page)
    • the check that the trash dir for the user, which is under rootTrashDir, has 'rwx' permissions for the user will fail if the rootTrashDir, or any dir in its path, is inaccessible (the parent rootTrashDir needs to have 'r' and 'x', without 'x', we can't enter the dir at all)
  • Make a QString non-const to get rid of an #ifdef block

Edited by Ahmad Samir

Merge request reports