[Bug 240157] cp has no ability to preserve extended attributes when copying a file

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 27 22:10:56 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240157

            Bug ID: 240157
           Summary: cp has no ability to preserve extended attributes when
                    copying a file
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: sean at rogue-research.com

I was very surprised to see that neither 'cp -p' nor 'cp -a' preserve the
extended attributes of a file.

example:

root at freenas[/test]# lsextattr user A.txt 
A.txt   DosStream.com.apple.TextEncoding:$DATA  DosStream.AFP_Resource:$DATA   
DosStream.AFP_AfpInfo:$DATA     DOSATTRIB      
DosStream.com.apple.lastuseddate#PS:$DATA


root at freenas[/test]# cp -a A.txt A2.txt      


root at freenas[/test]# lsextattr user A2.txt
A2.txt


EAs sometimes contain important data, and there should surely be some kind of
option to preserve them when copying a file.

In contrast, macOS's cp -p does preserve EAs.

See also #240146 for related bug against the cp man page for saying nothing.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list