From 8a86223d45be7597b229a95381aebab3512bf6d7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 31 Jan 2007 23:01:50 +0100 Subject: * tests/cp/cp-a-selinux: New file. Test for the bug reported in * tests/cp/Makefile.am (TESTS): Add cp-a-selinux. * tests/selinux: New file. * tests/Makefile.am (EXTRA_DIST): Add selinux. * tests/misc/selinux: Source the new script, rather than open coding it. Change how "cp -a" and "cp --preserve=context" work with SELinux. Now, cp -a attempts to preserve context, but failure to do so does not change cp's exit status. However "cp --preserve=context" is similar, but failure *does* cause cp to exit with nonzero status. * src/copy.h (struct cp_options) [require_preserve_context]: New member. * src/copy.c (copy_reg, copy_internal): Implement the above. * src/mv.c (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (decode_preserve_arg): Set it or reset it. FIXME: add an on-writable-NFS-only test --- tests/misc/selinux | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tests/misc/selinux') diff --git a/tests/misc/selinux b/tests/misc/selinux index b8499842b..3e2aae5e2 100755 --- a/tests/misc/selinux +++ b/tests/misc/selinux @@ -12,14 +12,9 @@ fi . $srcdir/../envvar-check . $srcdir/../lang-default +. $srcdir/../selinux PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check -test "`ls -Zd .`" = '? .' && - { - echo "$0: skipping this test; this system lacks SELinux support" 1>&2 - exit 77 - } - pwd=`pwd` t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0 -- cgit v1.2.3-54-g00ecf