X-Spam-Checker-Version: SpamAssassin 3.3.0-rupdated (updated) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable version=3.3.0-rupdated Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id mA4GHMYH014567 for ; Tue, 4 Nov 2008 08:17:22 -0800 X-ASG-Debug-ID: 1225815444-63e1003f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx2.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F29D014DDEED for ; Tue, 4 Nov 2008 08:17:24 -0800 (PST) Received: from mx2.redhat.com (mx2.redhat.com [66.187.237.31]) by cuda.sgi.com with ESMTP id xfJOu1Y7VhCBQA7t for ; Tue, 04 Nov 2008 08:17:24 -0800 (PST) Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mA4GHNx8003522 for ; Tue, 4 Nov 2008 11:17:23 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mA4GHNOt011676 for ; Tue, 4 Nov 2008 11:17:23 -0500 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mA4GHM0g030880 for ; Tue, 4 Nov 2008 11:17:22 -0500 Message-ID: <49107592.3030800@sandeen.net> Date: Tue, 04 Nov 2008 10:17:22 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: xfs mailing list X-ASG-Orig-Subj: [PATCH] xfstests: mount with security context if SELinux is enabled Subject: [PATCH] xfstests: mount with security context if SELinux is enabled Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-Barracuda-Connect: mx2.redhat.com[66.187.237.31] X-Barracuda-Start-Time: 1225815444 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.9460 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- When SELinux is enabled, it adds extra xattrs for security attributes which can change the output of various tests, causing them to fail. If SELinux is enabled, mount with a liberal/permissive context for the entire filesystem, so that SELinux xattrs don't get created. Signed-off-by: Eric Sandeen --- Index: xfs-cmds/xfstests/common.rc =================================================================== --- xfs-cmds.orig/xfstests/common.rc +++ xfs-cmds/xfstests/common.rc @@ -39,9 +39,18 @@ dd() _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 [ "$HOSTOS" == "Linux" ]; then + if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then + SELINUX_OPTIONS="-o context=system_u:object_r:nfs_t:s0" + fi + fi + case $FSTYP in xfs) - export MOUNT_OPTIONS=$XFS_MOUNT_OPTIONS + export MOUNT_OPTIONS="$XFS_MOUNT_OPTIONS $SELINUX_OPTIONS" ;; udf) export MOUNT_OPTIONS=$UDF_MOUNT_OPTIONS