summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/context_mount.c
diff options
context:
space:
mode:
authorKarel Zak2011-01-13 10:43:33 +0100
committerKarel Zak2011-01-13 10:43:33 +0100
commit30e43998cf70e0891aff5b025a3c37f1c1581432 (patch)
treede4fb04a7142ba9a11d61f58a37d274631061d91 /shlibs/mount/src/context_mount.c
parentmount: fix reference to cifs-utils in mount.8 (diff)
downloadkernel-qcow2-util-linux-30e43998cf70e0891aff5b025a3c37f1c1581432.tar.gz
kernel-qcow2-util-linux-30e43998cf70e0891aff5b025a3c37f1c1581432.tar.xz
kernel-qcow2-util-linux-30e43998cf70e0891aff5b025a3c37f1c1581432.zip
libmount: improve fstab/mtab options usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context_mount.c')
-rw-r--r--shlibs/mount/src/context_mount.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/shlibs/mount/src/context_mount.c b/shlibs/mount/src/context_mount.c
index caad3e32f..1180d8eb0 100644
--- a/shlibs/mount/src/context_mount.c
+++ b/shlibs/mount/src/context_mount.c
@@ -175,6 +175,12 @@ static int evaluate_permissions(mnt_context *cxt)
/*
* user mount
*/
+ if (!(cxt->flags & MNT_FL_TAB_APPLIED))
+ {
+ DBG(CXT, mnt_debug_h(cxt, "fstab not applied, ignore user mount"));
+ return -EPERM;
+ }
+
if (u_flags & (MNT_MS_OWNER | MNT_MS_GROUP))
cxt->mountflags |= MS_OWNERSECURE;