-
-
Notifications
You must be signed in to change notification settings - Fork 824
Open
Labels
Milestone
Description
When I mount a borg repository as non-root user through the following /etc/fstab entry:
/path/to/repo /mnt/repo fuse.borgfs defaults,noauto,user 0 0
as described in the documentation, I get the following permission error.
$ mount /mnt/repo
Enter passphrase for key /path/to/repo:
Local Exception
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/borg/archiver.py", line 4157, in main
exit_code = archiver.run(args)
File "/usr/local/lib/python3.6/dist-packages/borg/archiver.py", line 4089, in run
return set_ec(func(args))
File "/usr/local/lib/python3.6/dist-packages/borg/archiver.py", line 1324, in do_mount
return self._do_mount(args)
File "/usr/local/lib/python3.6/dist-packages/borg/archiver.py", line 138, in wrapper
kwargs['manifest'], kwargs['key'] = Manifest.load(repository, compatibility)
File "/usr/local/lib/python3.6/dist-packages/borg/helpers.py", line 334, in load
key = key_factory(repository, cdata)
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 131, in key_factory
return identify_key(manifest_data).detect(repository, manifest_data)
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 572, in detect
if key.load(target, passphrase):
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 763, in load
success = self._load(key_data, passphrase)
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 603, in _load
self.tam_required = key.get('tam_required', tam_required(self.repository))
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 140, in tam_required
file = tam_required_file(repository)
File "/usr/local/lib/python3.6/dist-packages/borg/crypto/key.py", line 135, in tam_required_file
security_dir = get_security_dir(bin_to_hex(repository.id))
File "/usr/local/lib/python3.6/dist-packages/borg/helpers.py", line 494, in get_security_dir
security_dir = os.environ.get('BORG_SECURITY_DIR', os.path.join(get_config_dir(), 'security'))
File "/usr/local/lib/python3.6/dist-packages/borg/helpers.py", line 525, in get_config_dir
os.makedirs(config_dir)
File "/usr/lib/python3.6/os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "/usr/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/root/.config'
Platform: Linux hostname 4.13.0-1-marvell #1 Debian 4.13.4-2 (2017-10-15) armv5tel
Linux: debian buster/sid
Borg: 1.1.3 Python: CPython 3.6.3
PID: 10713 CWD: /home/user/bin
sys.argv: ['/usr/local/bin/borgfs', '/path/to/repo', '/mnt/repo', '-o', 'rw,noexec,nosuid,nodev']
SSH_ORIGINAL_COMMAND: None
From the backtrace it looks like the security dir is not set, resulting in borg trying to write to /root/.config, but I don't know the proper way to tell borg where to look for the security directory in the /etc/fstab scenario.
This problem does not occur when I mount the repo manually (borg mount /path/to/repo /mnt/repo).
Is this a problem with my configuration, or is the documentation incomplete on how mount a borg repo through /etc/fstab?
Reactions are currently unavailable