Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
a4c0cc7 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: #368
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Oct 27, 2016
1 parent a50c849 commit 3c4a3de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libmount/src/context_mount.c
Expand Up @@ -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
Expand Down

0 comments on commit 3c4a3de

Please sign in to comment.