[PATCH] Make SELinux protection conditional

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



When selinux utilities are present, xfstests add options to help circumvent
selinux protection. However, on Chrome OS, it leads to the opposite effect,
when it prevents mount to succeed.

BUG=chromium:669641
TEST=xfstest test ext4/001 completes where it use to display:
common/rc: could not mount /dev/loop29 on /usr/local/autotest/tmp/xfstests_TEST

Signed-off-by: Gwendal Grignou <gwendal@xxxxxxxxxxxx>
---
 common/config | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/config b/common/config
index fb60216c..0c7335ad 100644
--- a/common/config
+++ b/common/config
@@ -35,6 +35,7 @@
 # RMT_TAPE_DEV -    the remote tape device for the xfsdump tests
 # RMT_IRIXTAPE_DEV- the IRIX remote tape device for the xfsdump tests
 # RMT_TAPE_USER -   remote user for tape device
+# SELINUX_MOUNT_OPTIONS - Options to use when SELinux is enabled.
 #
 # - These can be added to $HOST_CONFIG_DIR (witch default to ./config)
 #   below or a separate local configuration file can be used (using
@@ -262,7 +263,7 @@ esac
 # 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"
+	: ${SELINUX_MOUNT_OPTIONS:="-o context=system_u:object_r:nfs_t:s0"}
 	export SELINUX_MOUNT_OPTIONS
 fi
 
-- 
2.12.0.rc1.440.g5b76565f74-goog

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux