PackBlob is a limited interface that only exposes a part of the
information provided by PackedBlob. Most of the changes are switches
from direct value lookups to the interface methods, with a few larger
changes to let the tests still work.
Prepare `CopyBlobs` to allow access to unexported methods of the
Repository struct. This requires changing the test to inject the number
of backend connections via a wrapped backend instead of a wrapped
repository.
Mounting a local repository onto its own directory caused the FUSE
server to read its own backend files through the mount it had just
created, deadlocking the kernel. `umount` then reported "Device or
resource busy" and recovery required a reboot that took several
minutes. The same shape occurs when the mountpoint is nested inside
the repository directory, or when the repository directory is nested
inside the mountpoint.
The mount command now resolves both paths via filepath.Abs and
filepath.EvalSymlinks and refuses with a fatal error if either path
equals or contains the other. The check runs before the repository
lock is acquired so an overlap fails fast. Only the local backend is
checked; remote backends cannot shadow the mountpoint directory.
* mount: check for more requisite mountpoint conditions
In order to be able to mount a repository over a mountpoint target
directory via FUSE, that target directory needs to be both writeable and
executable for the UID performing the mount.
Without this patch, `restic mount` only checks for the target pathname's
existence, which can lead to a lot of data transfer and/or computation
for large repos to be performed before eventually croaking with a fatal
"fusermount: failed to chdir to mountpoint: Permission denied" (or
similar) error.
FUSE does allow for mounting over a target path that refers to a regular
(writeable) file, but the result is not accessible via chdir(), so we
prevent that as well, and accept only directory inodes as the intended
target mountpoint path.
* Don't use snake_case identifiers
* Add changelog entry
* tweak changelog summary
---------
Co-authored-by: Michael Eischer <michael.eischer@fau.de>