diff options
author | Niels de Vos <ndevos@redhat.com> | 2015-12-02 21:19:56 +0100 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-12-03 02:31:01 -0800 |
commit | e6046ddc62a61f63d3c2ff2fb450c07c0604e801 (patch) | |
tree | 0bef18322931fa05a3435ae884f94d5696f8765f /xlators/mount | |
parent | 0d46f1b0519f93165a335bf264661054883b522f (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.
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>
Diffstat (limited to 'xlators/mount')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 5 |
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 |