[Bug 240146] 'man cp' does not discuss extended attributes; it really should since even -p discards them!

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 27 14:15:48 UTC 2019


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

            Bug ID: 240146
           Summary: 'man cp' does not discuss extended attributes; it
                    really should since even -p discards them!
           Product: Documentation
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Manual Pages
          Assignee: bugs at FreeBSD.org
          Reporter: sean at rogue-research.com
                CC: doc at FreeBSD.org

The man page for 'cp' does not contain the word "extended" nor "attribute".

I was very surprised to see that even 'cp -p' apparently does not preserve the
extended attributes of a file.

I'd argue 'cp -p' behaviour is wrong, but at the very least it should be
documented.

By contrast, the macOS 10.13 man page says: "-p    Cause cp to preserve the
following attributes of each source file in the copy: modification time, access
time, file flags, file mode, user ID, and group ID, as allowed by permissions. 
Access Control Lists (ACLs) and Extended Attributes (EAs), including resource
forks, will also be preserved."

A simple sentence to warn that cp -p will blow away EAs would help.  We're
talking about data loss here. :(

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-doc mailing list