Commit 7ae5ae3
committed
Resolve symlinks in device path for removable check
When running with --removable-device, the basename of dest is used to
construct the path of the "removable" sysfs file for the
device. However, if dest is a symlink the basename may be very
different from the actual device name, and theoretically might even
match a different device. Make the path absolute and resolve any
symlinks before taking the basename to avoid that problem.
This is of practical importance because it allows using
/dev/disk/... symlinks created by udev, which is much less error-prone
than using e.g. /dev/sdX.
Signed-off-by: Fiona Klute <[email protected]>1 parent 618a731 commit 7ae5ae3
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
| |||
0 commit comments