config: fix selinux context handling
authorJosef Bacik <jbacik@fb.com>
Tue, 13 May 2014 05:30:15 +0000 (15:30 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 13 May 2014 05:30:15 +0000 (15:30 +1000)
With the new config stuff we lost the selinux options being set for systems with
selinux turned on.  We want the selinux context set all the time, wether we
provide a MOUNT_OPTIONS value or not, so take this logic out of _mount_opts()
and just put it in the body of common/config

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/config

index 5d87ef5912324e32f6658ac8f4947028aa1bf32f..0dbf0b9c5ecba7b3b108210d73cd3d86ffd2c442 100644 (file)
@@ -217,16 +217,16 @@ case "$HOSTOS" in
         ;;
 esac
 
+# SELinux adds extra xattrs which can mess up our expected output.
+# So, mount with a context, and they won't be created
+# # nfs_t is a "liberal" context so we can use it.
+if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+       SELINUX_MOUNT_OPTIONS="-o context=system_u:object_r:nfs_t:s0"
+       export SELINUX_MOUNT_OPTIONS
+fi
+
 _mount_opts()
 {
-       # SELinux adds extra xattrs which can mess up our expected output.
-       # So, mount with a context, and they won't be created
-       # # nfs_t is a "liberal" context so we can use it.
-       if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
-               SELINUX_MOUNT_OPTIONS="-o context=system_u:object_r:nfs_t:s0"
-               export SELINUX_MOUNT_OPTIONS
-       fi
-
        case $FSTYP in
        xfs)
                export MOUNT_OPTIONS=$XFS_MOUNT_OPTIONS