Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In some cases, rmw has unpredictable behavior when restoring from a removable device #299

Closed
andy5995 opened this issue Apr 7, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@andy5995
Copy link
Member

andy5995 commented Apr 7, 2021

How I reproduced this error:

  1. Removed files from /mnt/flash (where flash is the topdir) using the "move to trash" option from the thunar file manager in xfce

  2. Attempted to restore with rmw produced this error:

$ rmw -vz *
config file: /home/andy/.config/rmwrc
most recent list (mrl file): /home/andy/.local/share/rmw/mrl
Duplicate filename at destination - appending time string...
  :error: A NULL string was passed to bufchk. That should not happen.
Please report this bug to the rmw developers.

Looking at the info files created when I used "move to trash", I saw that the absolute path was not used for the "Path" key. Reading the Freedesktop trash spec, I saw that is correct

The key “Path” contains the original location of the file/directory, as either an absolute pathname (starting with the slash character “/”) or a relative pathname (starting with any other character). A relative pathname is to be from the directory in which the trash directory resides (for example, from $XDG_DATA_HOME for the “home trash” directory); it MUST not include a “..” directory, and for files not “under” that directory, absolute pathnames must be used. The system SHOULD support absolute pathnames only in the “home trash” directory, not in the directories under $topdir.

rmw was designed (incorrectly) to always expect an absolute path and parse the Path key accordingly

And due to the nature of this problem, other errors while trying to restore with rmw include files getting "restored" to the $trash/files folder in some cases (e.g. if rmw -z is used from the $trash/files directory, the relative path from its corresponding trashinfo file is used).

@andy5995
Copy link
Member Author

I'm picking away at this a little bit almost every day. Almost done; mostly just working on tests. Branch patch/iss-299.

Due to the nature of this bug, once this issue is closed, a release should follow soon after.

zvezdochiot pushed a commit to FS-make-simple/rmw that referenced this issue Sep 5, 2022
…ossibleastronaut#299)

* allow script tests to run in parallel (use different dirs)
* add unit test for parse_line_waste()
* get UID for basic test script
* allow, write, and expect relative paths in Path key, in some cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant