Skip to content

Enhanced white space handling for restore paths on linux #641

Open
@ziotibia81

Description

@ziotibia81

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:

  1. Select a Snapshot
  2. Browse into a directory of this shapshot
  3. Select "Restore to path"
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions