From f6c0c0ee16b5ebe8a74e288893995bf5995f3edd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 9 Sep 2000 08:18:10 +0000 Subject: *** empty log message *** --- tests/cp/special-bits | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tests/cp/special-bits (limited to 'tests/cp/special-bits') diff --git a/tests/cp/special-bits b/tests/cp/special-bits new file mode 100755 index 000000000..7658b098d --- /dev/null +++ b/tests/cp/special-bits @@ -0,0 +1,33 @@ +#!/bin/sh +# make sure `cp -p' preserves special bits +# This works only when run as root. + +if test "$VERBOSE" = yes; then + set -x + cp --version +fi + +pwd=`pwd` +tmp=spec-bits.$$ +trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0 +trap '(exit $?); exit' 1 2 13 15 + +framework_failure=0 +mkdir $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +touch a b || framework_failure=1 +chmod u+sx,go= a || framework_failure=1 +chmod u=rwx,g=sx,o= b || framework_failure=1 + +if test $framework_failure = 1; then + echo 'failure in testing framework' + exit 1 +fi + +fail=0 + +cp -p a a2 || fail=1 +cp -p b b2 || fail=1 + +(exit $fail); exit -- cgit v1.2.3-54-g00ecf