diff options
author | Niels de Vos <ndevos@redhat.com> | 2015-12-02 21:19:56 +0100 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-12-16 03:27:13 -0800 |
commit | b55959c5909b3c32aca18f0c77eced134b38db56 (patch) | |
tree | ff578ed730dca60b6e7671aa809c071d2a764470 | |
parent | 5d264dbcb7cd08337105417014dccc8fda6f169a (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>
BUG: 1287878
Change-Id: I015fe27e4c6ff36a030e3480b23141aca2d91fc2
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: http://review.gluster.org/12871
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-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 0db77263373..bcaef37c3b6 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 |