xfstests: mount all filesystem typess with selinux context when needed
authorEric Sandeen <sandeen@sandeen.net>
Fri, 27 Jan 2012 18:26:26 +0000 (12:26 -0600)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 27 Jan 2012 18:26:26 +0000 (12:26 -0600)
For some reason, non-xfs filesystems weren't getting mounted with
the selinux context; perhaps because none of the xattr tests used
to work on anything but xfs?

Anyway, 062 fails for extN unless we mount with the fs-wide
context.

So export SELINUX_MOUNT_OPTIONS for all filesystems.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
common.rc

index 6231457c017eb263b3e256a5542b03418e1780f0..602513af8ab3dd63984692e46d1824dee6657151 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -72,11 +72,11 @@ _mount_opts()
     # 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 SELINUX_MOUNT_OPTIONS
        export MOUNT_OPTIONS=$XFS_MOUNT_OPTIONS
        ;;
     udf)