summaryrefslogtreecommitdiff
path: root/tests/cp/cp-parents.sh
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2023-05-03 17:01:37 +0100
committerPádraig Brady <P@draigBrady.com>2023-05-03 18:15:59 +0100
commitc6b1fe43474b48a6bf5793e11cc1d0d6e895fdf4 (patch)
treefbfd84835c5df364f23a6e05135c58894bc15856 /tests/cp/cp-parents.sh
parent7223651ad194a5868b58c1be6c7452fd3ca2f75a (diff)
downloadcoreutils-c6b1fe43474b48a6bf5793e11cc1d0d6e895fdf4.tar.gz
cp: -p --parents: fix failure to preserve permissions for absolute paths
* src/cp.c (re_protect): Ensure copy_acl() is passed an absolute path. * tests/cp/cp-parents.sh: Add a test case. * NEWS: Mention the bug. Fixes https://bugs.gnu.org/63245
Diffstat (limited to 'tests/cp/cp-parents.sh')
-rwxr-xr-xtests/cp/cp-parents.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/cp/cp-parents.sh b/tests/cp/cp-parents.sh
index 20963eace..9437504c2 100755
--- a/tests/cp/cp-parents.sh
+++ b/tests/cp/cp-parents.sh
@@ -66,4 +66,10 @@ p=$(ls -ld g/sym/b/c|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
cp --parents --no-preserve=mode np/b/file np_dest/ || fail=1
p=$(ls -ld np_dest/np|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
+# coreutils 9.1-9.3 inclusive would fail to copy acls for absolute dirs
+mkdir dest || framework_failure_
+if test -f /bin/ls; then
+ cp -t dest --parents -p /bin/ls || fail=1
+fi
+
Exit $fail