diff options
author | Karel Zak | 2016-10-27 15:30:20 +0200 |
---|---|---|
committer | Karel Zak | 2016-10-27 15:30:20 +0200 |
commit | 3c4a3de0fcb8f21bffacfd8bdc3d6fbd683c71f5 (patch) | |
tree | 844de3ef1df287118da9c81eeddf339c12844be5 /libmount/src/context_mount.c | |
parent | libfdisk: cleanup labelitem initialization (diff) | |
download | kernel-qcow2-util-linux-3c4a3de0fcb8f21bffacfd8bdc3d6fbd683c71f5.tar.gz kernel-qcow2-util-linux-3c4a3de0fcb8f21bffacfd8bdc3d6fbd683c71f5.tar.xz kernel-qcow2-util-linux-3c4a3de0fcb8f21bffacfd8bdc3d6fbd683c71f5.zip |
mount: append inverting options for mount.<type> on "users"
If you call mount(8) as root, then we need to append inverting options
(if specified by fstab) for "user" and "users" to /sbin/mount.<type>
command line, because for UID=0 mount.nfs follows command line rather
than the fstab setting.
This has been originally implemented by commit
a4c0cc75ff9744299f108c259efab1bd30c8007a for the old mount(8). The
same feature is supported by libmount, unfortunately for "user" only.
We need the same also for "users" to be backwardly compatible.
Addresses: https://github.com/karelzak/util-linux/issues/368
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_mount.c')
-rw-r--r-- | libmount/src/context_mount.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 91611efcd..a7ea83250 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -369,7 +369,8 @@ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr) if (!*optstr) return -ENOMEM; - if (cxt->user_mountflags & MNT_MS_USER) { + if ((cxt->user_mountflags & MNT_MS_USER) || + (cxt->user_mountflags & MNT_MS_USERS)) { /* * This is unnecessary for real user-mounts as mount.<type> * helpers always have to follow fstab rather than mount |