From 6e177448b9e204d384b8e12a38b386f3c53aa33e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 1 Apr 2008 16:34:08 +0200 Subject: Avoid root-only SELinux-related test failures w/o mcstransd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When mcstransd is not running (i.e., after service mcstrans stop), "make check" as root would provoke two test failures. * tests/cp/cp-a-selinux: Use the context, root:object_r:tmp_t:s0, that works both with and without mcstransd. Thanks to Eric Paris for the tip and to Ondřej Vašík for alerting me to the problem. Reported by Robert Scheck in . --- tests/cp/cp-a-selinux | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/cp/cp-a-selinux') diff --git a/tests/cp/cp-a-selinux b/tests/cp/cp-a-selinux index 33b4c2246..67894571c 100755 --- a/tests/cp/cp-a-selinux +++ b/tests/cp/cp-a-selinux @@ -2,7 +2,7 @@ # Ensure that cp -a and cp --preserve=context work properly. # In particular, test on a writable NFS partition. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007-2008 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,8 +35,11 @@ dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \ || framework_failure mkdir mnt || framework_failure mkfs -t ext2 -F blob > /dev/null 2>&1 || framework_failure -mount -oloop,context=system_u:object_r:removable_t blob mnt \ - || framework_failure + +# This context is special: it works even when mcstransd isn't running. +ctx=root:object_r:tmp_t:s0 + +mount -oloop,context=$ctx blob mnt || framework_failure cd mnt || framework_failure echo > f || framework_failure -- cgit v1.2.3-70-g09d2