On 28/11/2026 18:49, Pádraig Brady wrote:
On 28/11/2026 18:25, Andreas Gruenbacher wrote:
Add a test for the inherited permissions regression in qcopy_acl(): if
the source file did not have an acl, qcopy_acl() did not override
permissions the destination file may have inherited.
---
tests/cp/acl.sh | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/cp/acl.sh b/tests/cp/acl.sh
index 418e1e989..f6d4fd64c 100755
--- a/tests/cp/acl.sh
+++ b/tests/cp/acl.sh
@@ -26,7 +26,7 @@ require_acl_
grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
skip_ "insufficient ACL support"
-mkdir -p a b || framework_failure_
+mkdir -p a/dir b || framework_failure_
touch a/file || framework_failure_
# Ensure that setfacl and getfacl work on this file system.
@@ -57,4 +57,20 @@ compare /dev/null b/file || fail=1
acl2=$(cd b && getfacl file) || framework_failure_
test "$acl1" = "$acl2" || fail=1
+# files created in b will inherit this default acl
+setfacl -d -m user:bin:rwx b || fail=1
+
+# remove the acl of a/file
+setfacl -b a/file || fail=1
+
+# copy a file, removing the inherited permissions
+cp -p a/file b/ || fail=1
+test "$(cd a && getfacl file)" = "$(cd b && getfacl file)" || fail=1
+rm -f b/file || framework_failure_
+
+# copy a directory, removing the inherited permissions
+cp -rp a/dir b/ || fail=1
+test "$(cd a && getfacl dir)" = "$(cd b && getfacl dir)" || fail=1
+rm -rf b/dir || framework_failure_
+
Exit $fail
This fails with and without the just sent gnulib patch.
Sorry I've not looked at the coreutils acl stuff yet,
so I'm just reporting at this stage.
test log attached.
Oops ignore me.
I was confused with a dependency bug in the coreutils build
in a complicated combo of --enable-single-binary followed by `make syntax-check`
followed by make not updating the cp binary.
So it's OK to apply the gnulib patch.
I'll update coretuils to the latest gnulib and then apply this patch.
cheers,
Padraig