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.

thanks,
Padraig
===================================================================
   GNU coreutils 9.12.348-37fda-modified: ./tests/test-suite.log
===================================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

System information (uname -a): Linux 7.2.13-200.fc44.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Oct 26 18:54:52 UTC 2026 x86_64
Distribution information (/etc/os-release):
NAME="Fedora Linux"
VERSION="44 (Workstation Edition)"
RELEASE_TYPE=stable
ID=fedora
VERSION_ID=44
VERSION_CODENAME=""
PRETTY_NAME="Fedora Linux 44 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"

.. contents:: :depth: 2

FAIL: tests/cp/acl
==================

++ initial_cwd_=/home/padraig/git/coreutils
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/padraig/git/coreutils gt-acl.sh.XXXX
+++ case $# in
+++ destdir_=/home/padraig/git/coreutils
+++ template_=gt-acl.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ destdir_slash_=/home/padraig/git/coreutils/
+++ case $template_ in
++++ unset TMPDIR
+++ d=/home/padraig/git/coreutils/gt-acl.sh.qDbm
+++ case $d in
+++ :
+++ test -d /home/padraig/git/coreutils/gt-acl.sh.qDbm
++++ ls -dgo /home/padraig/git/coreutils/gt-acl.sh.qDbm
+++ perms='drwx------. 1 0 Nov 28 18:46 /home/padraig/git/coreutils/gt-acl.sh.qDbm'
+++ case $perms in
+++ :
+++ echo /home/padraig/git/coreutils/gt-acl.sh.qDbm
+++ return
++ test_dir_=/home/padraig/git/coreutils/gt-acl.sh.qDbm
++ cd /home/padraig/git/coreutils/gt-acl.sh.qDbm
++ case $srcdir in
++ srcdir=../.
++ builddir=..
++ export srcdir builddir
++ gl_init_sh_nl_=$'\n'
++ IFS=$' \t\n'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ saved_IFS=$' \t\n'
++ IFS=:
++ new_PATH=
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/git/coreutils/src/.
++ new_PATH=/home/padraig/git/coreutils/src
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/.local/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/.mozbuild/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/.local/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/bin/.npm-global/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /home/padraig/.cargo/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /usr/lib64/ccache/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /usr/local/sbin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /usr/local/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /usr/sbin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /usr/bin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
++ for dir in $PATH
++ IFS=$' \t\n'
++ case "$dir" in
++ test -d /sbin/.
++ new_PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
++ IFS=$' \t\n'
++ PATH=/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
++ export PATH
++ trap remove_tmp_ EXIT
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/home/padraig/git/coreutils/./src
+ case $abs_path_dir_ in
+ PATH=/home/padraig/git/coreutils/./src:/home/padraig/git/coreutils/src:/home/padraig/.local/bin:/home/padraig/.mozbuild/bin:/home/padraig/.local/bin:/home/padraig/bin:/home/padraig/bin/.npm-global/bin:/home/padraig/.cargo/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
+ create_exe_shims_ /home/padraig/git/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ cp
+ require_built_ cp
+ skip_=no
+ for i in "$@"
+ case " $built_programs " in
+ test no = yes
+ test yes = yes
+ local i
+ for i in $*
+ env cp --version
cp (GNU coreutils) 9.12.348-37fda-modified
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
+ require_acl_
+ getfacl --version
+ setfacl --version
+ id -u bin
+ grep '^#define USE_ACL 1' /home/padraig/git/coreutils/lib/config.h
+ mkdir -p a/dir b
+ touch a/file
+ skip=no
++ cd a
++ getfacl file
+ acl1=$'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\ngroup::r--\nother::r--'
+ setfacl -m user:bin:rw- a/file
+ test no = yes
+ cp a/file b/
++ cd b
++ getfacl file
+ acl2=$'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\ngroup::r--\nother::r--'
+ test $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\ngroup::r--\nother::r--' = $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\ngroup::r--\nother::r--'
++ cd a
++ getfacl file
+ acl1=$'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--'
+ cp -p a/file b/
++ cd b
++ getfacl file
+ acl2=$'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--'
+ test $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--' = $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--'
+ echo
+ test -s a/file
+ cp -p --attributes-only a/file b/
+ compare /dev/null b/file
+ compare_dev_null_ /dev/null b/file
+ test 2 = 2
+ test x/dev/null = x/dev/null
+ test -s b/file
+ return 0
+ return 0
++ cd b
++ getfacl file
+ acl2=$'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--'
+ test $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--' = $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\ngroup::r--\nmask::rw-\nother::r--'
+ setfacl -d -m user:bin:rwx b
+ setfacl -b a/file
+ cp -p a/file b/
++ cd a
++ getfacl file
++ cd b
++ getfacl file
+ test $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\ngroup::r--\nother::r--' = $'# file: file\n# owner: padraig\n# group: padraig\nuser::rw-\nuser:bin:rw-\t#effective:r--\ngroup::r--\nmask::r--\nother::r--'
+ fail=1
+ rm -f b/file
+ cp -rp a/dir b/
++ cd a
++ getfacl dir
++ cd b
++ getfacl dir
+ test $'# file: dir\n# owner: padraig\n# group: padraig\nuser::rwx\ngroup::r-x\nother::r-x' = $'# file: dir\n# owner: padraig\n# group: padraig\nuser::rwx\nuser:bin:rwx\t#effective:r-x\ngroup::r-x\nmask::r-x\nother::r-x\ndefault:user::rwx\ndefault:user:bin:rwx\ndefault:group::r-x\ndefault:mask::rwx\ndefault:other::r-x'
+ fail=1
+ rm -rf b/dir
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ test '' = yes
+ cd /home/padraig/git/coreutils
+ chmod -R u+rwx /home/padraig/git/coreutils/gt-acl.sh.qDbm
+ rm -rf /home/padraig/git/coreutils/gt-acl.sh.qDbm
+ exit 1
FAIL tests/cp/acl.sh (exit status: 1)

Reply via email to