View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002527 | Double Commander | File operations | public | 2020-09-18 16:11 | 2021-05-24 15:09 |
Reporter | noname00 | Assigned To | Alexx2000 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Projection | none | ETA | none | ||
OS | Linux | ||||
Product Version | 0.9.9 | ||||
Target Version | 1.0.0 | Fixed in Version | 1.0.0 | ||
Summary | 0002527: Individual files deleted to trash remain in original folder | ||||
Description | Folders are moved to $XDG_DATA_HOME/Trash correctly, but individual files remain in their original location. $ ls -R .: $ touch file $ mkdir folder ### after deleting file and folder to trash: $ ls -R .: file.Trash-1000 ./file.Trash-1000: files info ./file.Trash-1000/files: file_3809606769132 ./file.Trash-1000/info: file_3809606769132.trashinfo $ ls -R $XDG_DATA_HOME/Trash /home/demo/.local/share/Trash: files info /home/demo/.local/share/Trash/files: folder_3809606769132 /home/demo/.local/share/Trash/files/folder_3809606769132: /home/demo/.local/share/Trash/info: folder_3809606769132.trashinfo | ||||
Tags | No tags attached. | ||||
Attached Files | trash.patch (780 bytes)
Index: src/platform/utrash.pas =================================================================== --- src/platform/utrash.pas (revision 9558) +++ src/platform/utrash.pas (working copy) @@ -207,8 +207,11 @@ // Get user home directory sHomeDir:= GetHomeDir; // Check if file in home directory - if (fpLStat(UTF8ToSys(sHomeDir), st1) >= 0) + // If it's a file, stat the parent directory instead for correct behavior on OverlayFS, + // it shouldn't make any difference in other cases + if (fpStat(UTF8ToSys(sHomeDir), st1) >= 0) and (fpLStat(UTF8ToSys(FileName), st2) >= 0) + and (fpS_ISDIR(st2.st_mode) or (fpStat(UTF8ToSys(ExtractFileDir(FileName)), st2) >= 0)) and (st1.st_dev = st2.st_dev) then begin // Get trash directory in $XDG_DATA_HOME | ||||
Fixed in Revision | 9794 | ||||
Operating system | Linux | ||||
Widgetset | GTK2 | ||||
Architecture | 64-bit | ||||
|
I cannot reproduce. Where you are create and delete files? Which directory? |
|
In the home directory or its subdirectory. |
|
The problem was that I was doing it on OverlayFS. Many live Linux images use it these days, so it's a pretty common use case. I found that Gnome had the same issue before: https://bugzilla.gnome.org/show_bug.cgi?id=748248 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/182/diffs With the attached patch it works correctly. Changing fpLStat to fpStat for sHomeDir isn't directly related to this issue, but it looks like it should be fpStat. The issue with trashing is the only one I've noticed so far, but I suspect that FindMountPointPath may need a similar fix if it's called with file names instead of directory names from somewhere. |
|
What now, any feedback on the patch? I guess I should add the steps to reproduce it in an installed system. # Mount OverlayFS mkdir lower upper work overlay sudo mount -t overlay -o rw,lowerdir=./lower,upperdir=./upper,workdir=./work dc-test-overlay ./overlay # Create a user with the home directory on OverlayFS sudo adduser --home `pwd`/overlay/dc-test-home dc-test # Create a file there sudo -i -u dc-test touch test-file Log in as the new user (dc-test), launch doublecmd, delete the file to trash. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-09-18 16:11 | noname00 | New Issue | |
2020-09-23 08:32 | Alexx2000 | Note Added: 0003498 | |
2020-09-23 08:32 | Alexx2000 | Assigned To | => Alexx2000 |
2020-09-23 08:32 | Alexx2000 | Status | new => feedback |
2020-09-24 13:30 | noname00 | Note Added: 0003500 | |
2020-09-24 13:30 | noname00 | Status | feedback => assigned |
2020-10-08 08:20 | Alexx2000 | Status | assigned => acknowledged |
2020-10-08 08:20 | Alexx2000 | Resolution | open => unable to reproduce |
2020-10-12 12:46 | noname00 | File Added: trash.patch | |
2020-10-12 12:46 | noname00 | Note Added: 0003509 | |
2020-12-12 17:56 | noname02 | Note Added: 0003649 | |
2021-01-11 10:52 | Alexx2000 | Target Version | => 1.0.0 |
2021-05-24 15:09 | Alexx2000 | Fixed in Revision | => 9794 |
2021-05-24 15:09 | Alexx2000 | Status | acknowledged => resolved |
2021-05-24 15:09 | Alexx2000 | Fixed in Version | => 1.0.0 |
2021-05-24 15:09 | Alexx2000 | Resolution | unable to reproduce => fixed |