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

borg mount fails silently on trailing spaces #4221

Closed
nemoinis opened this issue Dec 18, 2018 · 4 comments
Closed

borg mount fails silently on trailing spaces #4221

nemoinis opened this issue Dec 18, 2018 · 4 comments
Assignees
Milestone

Comments

@nemoinis
Copy link

nemoinis commented Dec 18, 2018

Your borg version (borg -V).

borg 1.1.8

Operating system (distribution) and version.

Debian buster

Full borg commandline that lead to the problem (leave away excludes and passwords)

borg mount --prefix clientname /path/to/repo emptydir ""

Describe the problem you're observing.

borg mount silently fails when a command contains trailing spaces, as the one above. Of course I do not type such commands, but they occur as the result of bash scripts expansion of empty parameters, for example.

borg mount does mount the repo and the archives appear in 'emptydir', but they are all empty.

@ThomasWaldmann
Copy link
Member

IIRC, any trailing arguments will be interpreted to match archive contents. So, if you give the empty string there, it won't match anything.

@ThomasWaldmann ThomasWaldmann added this to the 2.0.0b6 milestone Apr 7, 2023
@ThomasWaldmann ThomasWaldmann modified the milestones: 2.0.0b6, 2.0.0rc1 May 12, 2023
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented May 12, 2023

Reproduced with borg 1.2.4+.

This is done in _process_archive, paths are all arguments after the mountpoint.

        matcher = Archiver.build_matcher(self._args.patterns, self._args.paths)

@ThomasWaldmann ThomasWaldmann modified the milestones: 2.0.0rc1, 1.4.0a1 Dec 26, 2023
@ThomasWaldmann ThomasWaldmann self-assigned this Dec 27, 2023
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 27, 2023
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 27, 2023
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 27, 2023
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 27, 2023
ThomasWaldmann added a commit that referenced this issue Dec 27, 2023
…s-1.4

PATH: do not accept empty strings, fixes #4221
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Dec 27, 2023

This issue is just one of multiple issues, other commands could also be strangely affected:

  • create
  • extract
  • recreate
  • diff
  • export-tar

This is why I used type=PathSpec instead of type=str in the argparser setup, it simply rejects empty strings.

@ThomasWaldmann
Copy link
Member

borg 1.4 is fixed by #8005.

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.4.0a1, 2.0.0rc1 Jan 1, 2024
ThomasWaldmann added a commit that referenced this issue Jan 2, 2024
…s-master

PATH: do not accept empty strings, fixes #4221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants