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.

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>
This commit is contained in:
Niels de Vos 2015-12-02 21:19:56 +01:00
parent 0d46f1b051
commit e6046ddc62

View File

@ -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