summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/utils
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-12-02 21:19:56 +0100
committerNiels de Vos <ndevos@redhat.com>2015-12-03 09:59:24 -0800
commit21b32ba1430e4a0e664423a4a7bf038a2da428bc (patch)
tree595772016c16a4c5770a0290c04bd1599c0133ca /xlators/mount/fuse/utils
parent113e2ac257cf75efd12fcfd47b7eed7ad08ee000 (diff)
fuse: pass default SElinux mount options on to the kernel
In order to set default SElinux contexts on a Gluster mount, the standard SElinux mount options need to be passed to the kernel. The mount(8) manual page lists "context", "fscontext", "defcontext" and "rootcontext" as valid options. Backport of http://review.gluster.org/#/c/12858/ Cherry-picked from commit 5e81233f0a3c153e03c437a164ac2ca21314bdec > BUG: 1287763 > Change-Id: I015fe27e4c6ff36a030e3480b23141aca2d91fc2 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/12858 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> > Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> > Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> BUG: 1287877 Change-Id: I015fe27e4c6ff36a030e3480b23141aca2d91fc2 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/12870 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/mount/fuse/utils')
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 112dc0a225b..ae3a075f9a8 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -467,6 +467,11 @@ with_options()
[ $value = "false" ] ; then
no_root_squash=1;
fi ;;
+ "context"|"fscontext"|"defcontext"|"rootcontext")
+ # standard SElinux mount options to pass to the kernel
+ [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts,"
+ fuse_mountopts="${fuse_mountopts}$key=\"$value\""
+ ;;
*)
warn "Invalid option: $key"
exit 1