Bug#1107169: cp --preserve=mode from nfs-mounted share works but returns error
Thx for looking into this. I don't claim to have any understanding of Linux ACLs, but I'm confused as to why this would work on a Debian 12 NFS client system and not on a Debian 13 client system.
Also, as far as I can tell, the source file does not have any ACLs on it.
On the Debian 12 NFS server:
getfacl /h/tmp/foobar
getfacl: Removing leading '/' from absolute path names
# file: h/tmp/foobar
# owner: root
# group: root
user::rw-
group::r--
other::r--
In any event, here's the output you requested, followed by the output from running the same command on Debian 12.
* Debian 13:
execve("/bin/cp", ["cp", "--preserve=mode", "/h/tmp/foobar", "."], 0x7ffc13dc3c48 /* 68 vars */) = 0
brk(NULL) = 0x55bac6c0a000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f30e29c2000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=25486, ...}) = 0
mmap(NULL, 25486, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f30e29bb000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=202984, ...}) = 0
mmap(NULL, 210640, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f30e2987000
mmap(0x7f30e298e000, 131072, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f30e298e000
mmap(0x7f30e29ae000, 36864, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7f30e29ae000
mmap(0x7f30e29b7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x30000) = 0x7f30e29b7000
mmap(0x7f30e29b9000, 5840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f30e29b9000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=38832, ...}) = 0
mmap(NULL, 41008, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f30e297c000
mmap(0x7f30e297e000, 20480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f30e297e000
mmap(0x7f30e2983000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f30e2983000
mmap(0x7f30e2985000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f30e2985000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=26544, ...}) = 0
mmap(NULL, 28696, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f30e2974000
mmap(0x7f30e2976000, 12288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f30e2976000
mmap(0x7f30e2979000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f30e2979000
mmap(0x7f30e297a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f30e297a000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\236\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 840, 64) = 840
fstat(3, {st_mode=S_IFREG|0755, st_size=2003408, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 840, 64) = 840
mmap(NULL, 2055800, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f30e277e000
mmap(0x7f30e27a6000, 1462272, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7f30e27a6000
mmap(0x7f30e290b000, 352256, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18d000) = 0x7f30e290b000
mmap(0x7f30e2961000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e2000) = 0x7f30e2961000
mmap(0x7f30e2967000, 52856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f30e2967000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=711216, ...}) = 0
mmap(NULL, 713544, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f30e26cf000
mmap(0x7f30e26d2000, 503808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f30e26d2000
mmap(0x7f30e274d000, 192512, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7e000) = 0x7f30e274d000
mmap(0x7f30e277c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xac000) = 0x7f30e277c000
close(3) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f30e26cd000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f30e26cb000
arch_prctl(ARCH_SET_FS, 0x7f30e26ce640) = 0
set_tid_address(0x7f30e26ce910) = 19236
set_robust_list(0x7f30e26ce920, 24) = 0
rseq(0x7f30e26ce4a0, 0x20, 0, 0x53053053) = 0
mprotect(0x7f30e2961000, 16384, PROT_READ) = 0
mprotect(0x7f30e277c000, 4096, PROT_READ) = 0
mprotect(0x7f30e297a000, 4096, PROT_READ) = 0
mprotect(0x7f30e2985000, 4096, PROT_READ) = 0
mprotect(0x7f30e29b7000, 4096, PROT_READ) = 0
mprotect(0x55bab3307000, 4096, PROT_READ) = 0
mprotect(0x7f30e29fe000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7f30e29bb000, 25486) = 0
statfs("/sys/fs/selinux", 0x7ffc03b64d40) = -1 ENOENT (No such file or directory)
statfs("/selinux", 0x7ffc03b64d40) = -1 ENOENT (No such file or directory)
getrandom("\x64\xee\x8f\xb9\x18\xa4\x33\x29", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55bac6c0a000
brk(0x55bac6c2b000) = 0x55bac6c2b000
openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "nodev\tsysfs\nnodev\ttmpfs\nnodev\tbd"..., 1024) = 398
read(3, "", 1024) = 0
close(3) = 0
access("/etc/selinux/config", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3063024, ...}) = 0
mmap(NULL, 3063024, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f30e2200000
close(3) = 0
geteuid() = 0
newfstatat(AT_FDCWD, "/h/tmp/foobar", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "foobar", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
openat(AT_FDCWD, "/h/tmp/foobar", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
openat(AT_FDCWD, "foobar", O_WRONLY|O_TRUNC) = 4
ioctl(4, BTRFS_IOC_CLONE or FICLONE, 3) = -1 EXDEV (Invalid cross-device link)
fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
uname({sysname="Linux", nodename="d13", ...}) = 0
copy_file_range(3, NULL, 4, NULL, 9223372035781033984, 0) = -1 EXDEV (Invalid cross-device link)
mmap(NULL, 1056768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f30e25c9000
read(3, "", 1048576) = 0
fchmod(4, 0100644) = 0
flistxattr(3, NULL, 0) = 16
flistxattr(3, "system.nfs4_acl\0", 16) = 16
fgetxattr(3, "system.nfs4_acl", NULL, 0) = 80
fgetxattr(3, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\207\0\0\0\6OWNER@\0\0\0\0\0", 80) = 80
fsetxattr(4, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\207\0\0\0\6OWNER@\0\0\0\0\0", 80, 0) = -1 EOPNOTSUPP (Operation not supported)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=2996, ...}) = 0
read(5, "# Locale name alias data base.\n#"..., 4096) = 2996
read(5, "", 4096) = 0
close(5) = 0
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/gnulib.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
fcntl(1, F_GETFL) = 0x1 (flags O_WRONLY)
write(2, "cp: ", 4cp: ) = 4
write(2, "preserving permissions for \342\200\230./"..., 41preserving permissions for ‘./foobar’) = 41
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": Operation not supported", 25: Operation not supported) = 25
write(2, "\n", 1
) = 1
close(4) = 0
close(3) = 0
munmap(0x7f30e25c9000, 1056768) = 0
lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
close(0) = 0
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++
* Debian 12
execve("/bin/cp", ["cp", "--preserve=mode", "/h/tmp/foobar", "."], 0x7fffc3d84b98 /* 68 vars */) = 0
brk(NULL) = 0x5555be2cc000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=62096, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 62096, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fff5f924000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=198800, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 337464, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f8d0000
mmap(0x7fff5f8d0000, 271928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff5f8d0000
munmap(0x7fff5f914000, 58936) = 0
mprotect(0x7fff5f8fc000, 65536, PROT_NONE) = 0
mmap(0x7fff5f90c000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c000) = 0x7fff5f90c000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=67432, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 196656, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f89c000
mmap(0x7fff5f8a0000, 131120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff5f8a0000
munmap(0x7fff5f89c000, 16384) = 0
munmap(0x7fff5f8c4000, 32816) = 0
mprotect(0x7fff5f8a8000, 81920, PROT_NONE) = 0
mmap(0x7fff5f8bc000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7fff5f8bc000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=67432, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 196632, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f86c000
mmap(0x7fff5f870000, 131096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff5f870000
munmap(0x7fff5f86c000, 16384) = 0
munmap(0x7fff5f894000, 32792) = 0
mprotect(0x7fff5f878000, 81920, PROT_NONE) = 0
mmap(0x7fff5f88c000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7fff5f88c000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0000y\2\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1651408, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 1826912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f6b0000
mmap(0x7fff5f6b0000, 1761376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff5f6b0000
munmap(0x7fff5f860000, 57440) = 0
mprotect(0x7fff5f838000, 81920, PROT_NONE) = 0
mmap(0x7fff5f84c000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18c000) = 0x7fff5f84c000
mmap(0x7fff5f854000, 41056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fff5f854000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=592440, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 721648, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f5fc000
mmap(0x7fff5f600000, 656112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff5f600000
munmap(0x7fff5f5fc000, 16384) = 0
munmap(0x7fff5f6a4000, 33520) = 0
mprotect(0x7fff5f688000, 81920, PROT_NONE) = 0
mmap(0x7fff5f69c000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8c000) = 0x7fff5f69c000
close(3) = 0
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f95c000
set_tid_address(0x7fff5f95ca90) = 28981
set_robust_list(0x7fff5f95caa0, 24) = 0
rseq(0x7fff5f95d0e0, 0x20, 0, 0xd428bc00) = 0
mprotect(0x7fff5f84c000, 16384, PROT_READ) = 0
mprotect(0x7fff5f69c000, 16384, PROT_READ) = 0
mprotect(0x7fff5f88c000, 16384, PROT_READ) = 0
mprotect(0x7fff5f8bc000, 16384, PROT_READ) = 0
mprotect(0x7fff5f90c000, 16384, PROT_READ) = 0
mprotect(0x5555ad5ec000, 16384, PROT_READ) = 0
mprotect(0x7fff5f970000, 16384, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7fff5f924000, 62096) = 0
statfs("/sys/fs/selinux", 0x7fffe24d4b30) = -1 ENOENT (No such file or directory)
statfs("/selinux", 0x7fffe24d4b30) = -1 ENOENT (No such file or directory)
getrandom("\x09\xa0\x51\x36\xd5\xfc\xb8\xd4", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x5555be2cc000
brk(0x5555be2f0000) = 0x5555be2f0000
openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(3, "nodev\tsysfs\nnodev\ttmpfs\nnodev\tbd"..., 1024) = 427
read(3, "", 1024) = 0
close(3) = 0
faccessat(AT_FDCWD, "/etc/selinux/config", F_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3048928, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 3048928, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fff5f314000
close(3) = 0
geteuid() = 0
newfstatat(AT_FDCWD, "/h/tmp/foobar", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "foobar", 0x7fffe24d4750, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/h/tmp/foobar", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "foobar", O_WRONLY|O_CREAT|O_EXCL, 0644) = 4
ioctl(4, BTRFS_IOC_CLONE or FICLONE, 3) = -1 EXDEV (Invalid cross-device link)
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_EMPTY_PATH) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
copy_file_range(3, NULL, 4, NULL, 9223372035781033984, 0) = -1 EXDEV (Invalid cross-device link)
mmap(NULL, 1081344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5f20c000
read(3, "", 1048576) = 0
fgetxattr(3, "system.posix_acl_access", 0x7fffe24d42f0, 132) = -1 EOPNOTSUPP (Operation not supported)
fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = 0
close(4) = 0
close(3) = 0
munmap(0x7fff5f20c000, 1081344) = 0
lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
close(0) = 0
close(1) = 0
close(2) = 0
exit_group(0) = ?
+++ exited with 0 +++
-----Original Message-----
From: Bastian Blank <waldi@debian.org>
Sent: Tuesday, June 3, 2025 12:10 PM
To: 1107169-submitter@bugs.debian.org; 1107169@bugs.debian.org
Subject: Bug#1107169: cp --preserve=mode from nfs-mounted share works but returns error
Control: tags -1 moreinfo
On Mon, Jun 02, 2025 at 05:31:00PM +0000, bls 3427 wrote:
> and the NFS client disk are ext4.
>
> This works correctly and without error on a Debian 12 X64 or arm64 NFS client system.
>
> NFS server:
> * Debian 12 X64
> * File system fstab entry: /dev/disk/by-partuuid/6ce32e00-7481-b244-9924-f616c327c050 /h ext4 defaults,noatime 0 0
> * /etc/exports entry: /h 192.168.92.0/24(rw,no_root_squash,no_subtree_check,insecure)
>
> NFS client:
> * Debian 13 X64
> * fstab entry: mondo:/h /h nfs rw,noatime,x-systemd.automount,x-systemd.idle-timeout=3600 0 0
>
> * NFS mount via mount command: mondo:/h on /h type nfs4
> (rw,noatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto
> =tcp,timeo=600,retrans=2,sec=sys,clientaddr\
> =192.168.92.116,local_lock=none,addr=192.168.92.9,x-systemd.automount,
> x-systemd.idle-timeout=3600)
>
> Copying a file from the NFS server share to the NFS client with no switches works correctly.
>
> Copying with --preserve=mode copies the file correctly but exits with a failure status.
>
> d13~/test# ls -l l /h/tmp
> total 8
> drwxr-xr-x 2 root root 4096 Jun 2 10:15 .
> drwxr-xr-x 19 root root 4096 Jun 2 10:15 ..
> -rw-r--r-- 1 root root 0 Jun 2 10:15 foobar
> d13~/test# rm -f foobar
> d13~/test# cp /h/tmp/foobar .
> d13~/test# ls -l foobar
> -rw-r--r-- 1 root root 0 Jun 2 10:18 foobar d13~/test# rm -f foobar
> d13~/test# cp --preserve=mode /h/tmp/foobar .
> cp: preserving permissions for './foobar': Operation not supported
This error message means exactly what it tells: it can't copy some permissions, in this case posix acl. Aka the filesystem you are copying to lacks support for some acl parts.
Please show the output of "strace cp --preserve=mode /h/tmp/foobar .".
Bastian
--
"Life and death are seldom logical."
"But attaining a desired goal always is."
-- McCoy and Spock, "The Galileo Seven", stardate 2821.7
Reply to: