]> git.ipfire.org Git - thirdparty/util-linux.git/commit - sys-utils/mount.8.adoc
libmount: accept X-mount.{owner,group,mode}=
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Tue, 19 Apr 2022 14:56:07 +0000 (16:56 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Apr 2022 09:57:11 +0000 (11:57 +0200)
commit722c96974dd4009a334e4aee556eedaab5fb94b4
tree092718aff03a14666ce26d4a8106a06402c9c855
parent4848ba31acf05a020c7251d31184ec89f70dcf5a
libmount: accept X-mount.{owner,group,mode}=

Which take a user, group, and mode, respectively, and set them on the
target after mounting

This is vaguely similar to tmpfs(5)'s [ug]id= and mode= options,
but we POSIX-parse the user- and group names

Oft requested in systemd/zram-generator, since a common use-case
is to use it to create /tmp or an equivalent directory that needs
to be a=rwx,o+t (or a user's private temp that needs to be owned
by them) ‒ this is impossible without terrible hacks, cf.
https://github.com/systemd/zram-generator/issues/150,
https://github.com/systemd/zram-generator/issues/146, &c.

This started off as a Set{User,Group,Mode}= systemd mount unit,
but was poetterung into libmount options:
https://github.com/systemd/systemd/pull/22889

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/context_mount.c
libmount/src/libmount.h.in
libmount/src/mountP.h
libmount/src/optstr.c
libmount/src/utils.c
sys-utils/mount.8.adoc
tests/expected/mount/set_ugid_mode [new file with mode: 0644]
tests/ts/mount/set_ugid_mode [new file with mode: 0755]