]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: don't call hooks after mount.<type> helper
authorKarel Zak <kzak@redhat.com>
Thu, 25 May 2023 09:48:24 +0000 (11:48 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 5 Jun 2023 10:02:15 +0000 (12:02 +0200)
commit9d4d768f2dcb7a18dae15718238d9fbb87ba9f6e
treeef6149b5349d6ffa9eb75a51cfd4c4dfc2d1aa6f
parent98ed3edf8e1c47b669eff23072188b1a78bcab84
libmount: don't call hooks after mount.<type> helper

In case more filesystems are specified (or when libmount follows
/{etc,proc}/filesystems) then the library may try to use and
initialize the new API because for some filesystems, we need
exec(/sbin/mount.<type>) and for another fsopen().

The hooks that use the API have to smart and detect that the mount
operation was done in external /sbin/mount.<type> helper. And in this
case, the new API file descriptors must be ignored.

The exception is propagation flags, mount(8) can set the flags after
exec(/sbin/mount.<type>), for example, "mount -t ntfs --make-private".

Fixes: https://github.com/util-linux/util-linux/issues/2267
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/hook_mount.c