Re: Re: question related to cp (-p) and /tmp
On Tue, Jul 09, 2024 at 19:12:28 +0200, Patrice Duroux wrote:
> $ LANG=C strace cp -p test.sh /tmp
[...]
> read(6, "# /etc/xattr.conf\n#\n# Format:\n# "..., 4096) = 681
> read(6, "", 4096) = 0
> close(6) = 0
> fgetxattr(4, "system.nfs4_acl", NULL, 0) = 80
> fgetxattr(4, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\247\0\0\0\6OWNER@\0\0\0\0\0", 80) = 80
> fsetxattr(5, "system.nfs4_acl", "\0\0\0\3\0\0\0\0\0\0\0\0\0\26\1\247\0\0\0\6OWNER@\0\0\0\0\0", 80, 0) = -1 EOPNOTSUPP (Operation not supported)
> write(2, "cp: ", 4cp: ) = 4
> write(2, "preserving permissions for '/tmp"..., 41preserving permissions for '/tmp/test.sh') = 41
> write(2, ": Operation not supported", 25: Operation not supported) = 25
> write(2, "\n", 1
At this point, FD 4 is the source file (./test.sh) and FD 5 is the
destination file (/tmp/test.sh).
> $ mount | grep patrice
> /home/patrice type nfs4 (rw,nosuid,nodev,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=X,local_lock=none,addr=Y)
Looks like the error happens while trying to set the extended attributes
on the destination file. I don't really know how xattr works, but
it looks like it's trying to set an attribute named "system.nfs4_acl"
on a file that's in the /tmp directory.
I can't tell whether this is a bug in cp, or a bug in the kernel.
Someone who understands xattr might be better able to help.
> Finally, note that I am a «he» otherwise in French it's generally Patricia for
> «her»
> :-D
My apologies. Patrice is a feminine name in English.
Reply to: