DDiego Nicola Barbato wrote on 1 Oct 2019 15:41
(address . firstname.lastname@example.org)
I have added the following to `file-systems' in my operating-system
Toggle snippet (8 lines)
It works almost as expected except that when I try to mount the file
system as a regular user (which is what the option 'user' is supposed to
allow) I get:
$ LC_ALL=C mount inf
mount: /home/diego/inf: must be superuser to use mount.
The command succeeds if I run it as root.
The following steps reproduce the issue without using a 9p file system:
1. Prepare a file system on a loopback device:
$ dd if=/dev/zero of=foo.img bs=1024 count=524288
$ udisksctl loop-setup --file foo.img
Mapped file foo.img as /dev/loop0.
$ sudo mkfs.ext4 -L foofs /dev/loop0
2. Add the following line to /etc/fstab replacing <name> with something
LABEL=foofs /home/<name>/foofs ext4 defaults,user
3. Try to mount the filesystem as an unprivileged user (This should work
and does work on e.g. Debian 10):
$ mkdir foofs
$ LC_ALL=C mount foofs
mount: /home/<name>/foofs: must be superuser to use mount.
4. Try it with sudo to confirm that everything else works as expected:
$ sudo mount foofs
$ ls foofs