Similar issue to #497, but run on a NixOS system.
Steps to Reproduce
- Create a btrfs subvolume to be used as the waste basket
- Configure
rmw to use the subvolume as a waste basket
- Try to remove any directory with
rmw
Expected Behavior
The directory is moved to the wastebasket with all contained files.
Actual Outcome
No output to stderr nor stdout, but rmw exits with error code 1. The directory is still intact and the waste directory appears unchanged.
Additional Information
My guess is that the issue comes from safe_mv_via_exec, in particular the use of /bin/mv:
|
if (pid == 0) |
|
{ |
|
/* child: exec /bin/mv directly (argv[0] is "mv") */ |
|
char *const argv_mv[] = { "mv", (char *) src, (char *) dst, NULL }; |
|
execv("/bin/mv", argv_mv); |
|
/* if execv fails, set errno and exit with a distinct code */ |
|
_exit(127); |
|
} |
Since NixOS doesn't follow the Filesystem Hierarchy Standard, /bin/mv doesn't exist on my system:
$ ls -l /bin/mv
ls: cannot access '/bin/mv': No such file or directory
$ type mv
mv is /run/current-system/sw/bin/mv
$ echo "$PATH"
/run/wrappers/bin:/home/nixos/.nix-profile/bin:/nix/profile/bin:/home/nixos/.local/state/nix/profile/bin:/etc/profiles/per-user/nixos/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
Tested on a NixOS virtual machine. Using rmw version 0.9.4, installed via nix profile add github:NixOS/nixpkgs/pull/319544/head#rmw
Similar issue to #497, but run on a NixOS system.
Steps to Reproduce
rmwto use the subvolume as a waste basketrmwExpected Behavior
The directory is moved to the wastebasket with all contained files.
Actual Outcome
No output to
stderrnorstdout, butrmwexits with error code1. The directory is still intact and the waste directory appears unchanged.Additional Information
My guess is that the issue comes from
safe_mv_via_exec, in particular the use of/bin/mv:rmw/src/utils.c
Lines 518 to 525 in 6e7fcac
Since NixOS doesn't follow the Filesystem Hierarchy Standard,
/bin/mvdoesn't exist on my system:Tested on a NixOS virtual machine. Using
rmwversion0.9.4, installed vianix profile add github:NixOS/nixpkgs/pull/319544/head#rmw