diff options
author | Jim Meyering <jim@meyering.net> | 2000-10-31 08:12:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-10-31 08:12:28 +0000 |
commit | b8e83dda2bd722e6e5d02447a5d30720bf449d27 (patch) | |
tree | 76e56e5a6d8ae7ad64a375f767a173f397ddbb7f /tests | |
parent | 577627b257e08046d48e452c9e7f739e5aac0f27 (diff) | |
download | coreutils-b8e83dda2bd722e6e5d02447a5d30720bf449d27.tar.xz |
Add some permission tests.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cp/cp-parents | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/cp/cp-parents b/tests/cp/cp-parents index bab9c4fbf..de14ff914 100755 --- a/tests/cp/cp-parents +++ b/tests/cp/cp-parents @@ -7,6 +7,8 @@ if test "$VERBOSE" = yes; then mv --version fi +umask 022 + pwd=`pwd` tmp=cp-parents.$$ trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $tmp && exit $status' 0 @@ -18,7 +20,7 @@ framework_failure=0 mkdir $tmp || framework_failure=1 cd $tmp || framework_failure=1 mkdir foo bar || framework_failure=1 -mkdir -p a/b/c d || framework_failure=1 +mkdir -p a/b/c d e || framework_failure=1 if test $framework_failure = 1; then echo 'failure in testing framework' @@ -36,6 +38,11 @@ cp -R --parents foo/ bar || fail=1 cp --verbose -a --parents a/b/c d > /dev/null 2>&1 || fail=1 test -d d/a/b/c || fail=1 -# FIXME: add tests to check that re_protect works +# Check that re_protect works. +chmod go=w d/a +cp -a --parents d/a/b/c e || fail=1 +set _ `ls -ld e/d`; shift; case $1 in drwxr-xr-x);; *) fail=1;; esac +set _ `ls -ld e/d/a`; shift; case $1 in drwx-w--w-);; *) fail=1;; esac +set _ `ls -ld e/d/a/b/c`; shift; case $1 in drwxr-xr-x);; *) fail=1;; esac (exit $fail); exit |