Description
Describe the bug
During a restore operation, I inadvertently included a leading whitespace character in the restore path.
Backrest subsequently passed this path, including the leading whitespace, to Restic.
[repo-manager] 21:47:31.000Z debug restore snapshot {"repo": "repo-03-rest", "snapshot": "704b1e9fa656b2d02bff0d581a19182a88ebc4256d3cd75bef31d517c0568a2e", "target": " /media/disk4/snapshots/VBoxBK/20250116-dup/"}
Restic initiated a restore operation to the path "/ /path/". The operation encountered a "no space left on device" error, likely due to an incorrect path.
[restic] {"message_type":"error","error":{"message":"write / /media/disk4/snapshots/VBoxBK/20250116-dup/ [...]
To Reproduce
Steps to reproduce the behavior:
- Select a Snapshot
- Browse into a directory of this shapshot
- Select "Restore to path"
- Insert a whitespace before the path
Expected behavior
I expect that Backrest trims the string, removing leading and trailing whitespace, before passing it to Restic. If leading or trailing whitespace is required in the path, the path should be enclosed within quotes.
Platform Info
- Ubuntu 24.04.1 LTS x64
- Backrest 1.7.0
- Restic 0.17.3