]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mountpoint-util: tmpfs supports uid=/gid= mount options
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 6 Nov 2022 21:49:47 +0000 (22:49 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 6 Nov 2022 23:03:49 +0000 (00:03 +0100)
As tmpfs(5) says, both uid= and gid= are supported since kernel 2.5.7 and
the mount utility seems to agree:

```
# stat -c "%U:%G" mnt
root:root
# mount -o uid=testuser,gid=testuser -t tmpfs tmpfs mnt
# stat -c "%U:%G" mnt
testuser:testuser
```

However, systemd-mount currently complains:

```
# systemd-mount --owner testuser -t tmpfs tmpfs mnt
File system type tmpfs is not known to support uid=/gid=, refusing.
```

src/basic/mountpoint-util.c

index dc682688a7c358be4c0c0b3d18c9b6922b722341..8292869e7c9b30816123f1e2cbb9ec121f4ac0e4 100644 (file)
@@ -480,6 +480,7 @@ bool fstype_can_uid_gid(const char *fstype) {
                           "iso9660",
                           "msdos",
                           "ntfs",
+                          "tmpfs",
                           "vfat");
 }