From patchwork Fri May 9 20:40:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 4145031 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C133E9F1E1 for ; Fri, 9 May 2014 20:40:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E80FA20357 for ; Fri, 9 May 2014 20:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18B8520351 for ; Fri, 9 May 2014 20:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757152AbaEIUkf (ORCPT ); Fri, 9 May 2014 16:40:35 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:3781 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756913AbaEIUke (ORCPT ); Fri, 9 May 2014 16:40:34 -0400 Received: from pps.filterd (m0044008 [127.0.0.1]) by mx0a-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id s49KaoGB010915; Fri, 9 May 2014 13:40:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=3z/kGS8uF+F5MukTdxjLUyVd6hYQKj6RPlc3D1VQ4Fs=; b=cBAoT8OkyURXRC+7W6yataodnEOAsncynVqe116Li+glvH1rzCZfDuNpOJ8fPgsF3pUO C1darveFpkua9lZd0Ai9CmK6BzxdS8gN1NrIH5tU4DEK447k3YGuDBfcwC7nzG4cVQFJ KC1HZmBoaxWfESmz19Nb2pbAa3R9fT85JgI= Received: from mail.thefacebook.com (mailwest.thefacebook.com [173.252.71.148]) by mx0a-00082601.pphosted.com with ESMTP id 1krm6yvgq3-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Fri, 09 May 2014 13:40:31 -0700 Received: from localhost (192.168.57.29) by mail.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 9 May 2014 13:40:29 -0700 From: Josef Bacik To: , , Subject: [PATCH] xfstests: fix selinux context handling Date: Fri, 9 May 2014 16:40:27 -0400 Message-ID: <1399668027-12912-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [192.168.57.29] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96, 1.0.14, 0.0.0000 definitions=2014-05-09_08:2014-05-09, 2014-05-09, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 kscore.is_bulkscore=4.80221673537784e-09 kscore.compositescore=0 circleOfTrustscore=104.175033599216 compositescore=0.999738115633958 urlsuspect_oldscore=0.999738115633958 suspectscore=0 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=64355 rbsscore=0.999738115633958 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1405090267 X-FB-Internal: deliver Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Sandeen --- common/config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/config b/common/config index e8bcf48..a2f55cf 100644 --- a/common/config +++ b/common/config @@ -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