• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Metadata support
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Metadata support


  • Subject: Re: Metadata support
  • From: Dan Shoop <email@hidden>
  • Date: Tue, 27 Jun 2006 15:17:11 -0400

At 4:03 AM +0200 6/27/06, maurits wrote:
Apart from the creation date discussion, I guess it hasn't been absolutely clear yet what deficiencies in Apple's pertinent file copying tools people like Dan have complained here, so for completeness some facts, also to be found in my post [1]. Of course all Apple tools don't preserve creation dates, which is still topic of the discussion here...

- cp -Rp doesn't preserve symlink owners [2] (rdar://4523881)
- ditto doesn't preserve symlink owners (rdar://4523882), BSD flags, locked flag, HFS+ extended attributes, ACLs (forgot to file a rdar on these ones...)

ditto should (expectedly) mimic the Finder's copy functionality. As such an argument could be made that since the geometry of the files are different the ACL from one file shouldn't apply to the other.


- rsync -aE doesn't preserve BSD flags, locked flag, modification date of files with resource forks, ACLs (I'm sure there's gazillions of rdars)

It also doesn't appear to be able to copy files with both ACLs and resource forks. It appears to only work if you have one or the other. At least that was the last time I checked.


- asr (file-level) doesn't preserve symlink owners (rdar://4523924); in 10.4.6 there's a regression by which it doesn't preserve BSD flags, locked flag, HFS+ extended attributes, ACLs, either (rdar://4523878).

I haven't done any investigation of archive formats such as tar, so I can't tell how Apple's tools fare in that respect.

I have.

Findings:
=========

- ACLs stored and restored but modified in structure

- Extended Attributes generate error on creation of tarball, aren't restored

- symlink ownership changes

- creation dates maintained


Evidence: =========

# generate some files with various properties
ooblek:~/xyzzy dshoop$ touch file
ooblek:~/xyzzy dshoop$ touch fileacl
ooblek:~/xyzzy dshoop$ chmod +a "admin allow read" fileacl
ooblek:~/xyzzy dshoop$ touch filebsdflags
ooblek:~/xyzzy dshoop$ sudo chflags arch filebsdflags
Password:
ooblek:~/xyzzy dshoop$ touch filexattr
ooblek:~/xyzzy dshoop$ xattr --set color blue filexattr
ooblek:~/xyzzy dshoop$ sudo ln -s file filesymlink
ooblek:~/xyzzy dshoop$ ls -alseo
total 8
0 drwxr-xr-x     7 dshoop  dshoop  -     238 Jun 27 14:59 .
0 drwxrwx---   170 dshoop  dshoop  -    5780 Jun 27 14:56 ..
0 -rw-r--r--     1 dshoop  dshoop  -       0 Jun 27 14:57 file
0 -rw-r--r-- +   1 dshoop  dshoop  -       0 Jun 27 14:57 fileacl
 0: group:admin allow read
0 -rw-r--r--     1 dshoop  dshoop  arch    0 Jun 27 14:57 filebsdflags
8 lrwxr-xr-x     1 root    dshoop  -       4 Jun 27 14:59 filesymlink -> file
0 -rw-r--r--     1 dshoop  dshoop  -       0 Jun 27 14:58 filexattr
ooblek:~/xyzzy dshoop$ xattr --list *
file
fileacl
filebsdflags
filesymlink
filexattr
        color   blue

# create tarball of files
# note error generated on file with xattr!
ooblek:~/xyzzy dshoop$ /usr/bin/tar -cvf ../xyzzy.tar ./
./
./file
./._fileacl
./fileacl
./filebsdflags
./filesymlink
/usr/bin/tar: /tmp/tar.md.foSgCs: Cannot stat: No such file or directory
./filexattr
/usr/bin/tar: Error exit delayed from previous errors


# list tarball
# note Apple Double created only for file with ACL!
ooblek:~/xyzzy2 dshoop$ cd ../ ooblek:~ dshoop$ /usr/bin/tar -tvf xyzzy.tar
drwxr-xr-x dshoop/dshoop 0 2006-06-27 14:59:01 ./
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:15 ./file
-r-------- dshoop/wheel 223 2006-06-27 14:57:18 ./._fileacl
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:18 ./fileacl
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:57:44 ./filebsdflags
lrwxr-xr-x root/dshoop 0 2006-06-27 14:59:01 ./filesymlink -> file
-rw-r--r-- dshoop/dshoop 0 2006-06-27 14:58:24 ./filexattr


# extract tarball
ooblek:~ dshoop$ mkdir xyzzy2
ooblek:~ dshoop$ /usr/bin/tar -xv --preserve --atime-preserve -f xyzzy.tar -C xyzzy2/
./
./file
./._fileacl
./fileacl
./filebsdflags
./filesymlink
./filexattr


# note changed symlink ownership
ooblek:~ dshoop$ ls -alseo xyzzy2
total 8
0 drwxr-xr-x     7 dshoop  dshoop  -  238 Jun 27 15:10 .
0 drwxrwx---   171 dshoop  dshoop  - 5814 Jun 27 15:08 ..
0 -rw-r--r--     1 dshoop  dshoop  -    0 Jun 27 14:57 file
0 -rw-r--r-- +   1 dshoop  dshoop  -    0 Jun 27 14:57 fileacl
 0: group:admin allow read
0 -rw-r--r--     1 dshoop  dshoop  -    0 Jun 27 14:57 filebsdflags
8 lrwxrwxrwx     1 dshoop  dshoop  -    4 Jun 27 15:10 filesymlink -> file
0 -rw-r--r--     1 dshoop  dshoop  -    0 Jun 27 14:58 filexattr

# note changed xattr structure and missing xattr on filexattr
ooblek:~ dshoop$ xattr --list xyzzy2/*
xyzzy2/file
xyzzy2/fileacl
        com.apple.acl.text      !#acl 1
group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050:admin:80:allow:read

xyzzy2/filebsdflags
xyzzy2/filesymlink
xyzzy2/filexattr
ooblek:~ dshoop$ xattr --list xyzzy/*
xyzzy/file
xyzzy/fileacl
xyzzy/filebsdflags
xyzzy/filesymlink
xyzzy/filexattr
        color   blue

# note chreation date was properly restored
ooblek:~ dshoop$ /Developer/Tools/GetFileInfo xyzzy/file
file: "/Volumes/OoblekData/dshoop/xyzzy/file"
type: ""
creator: ""
attributes: avbstclinmedz
created: 06/27/2006 14:57:15
modified: 06/27/2006 14:57:15
ooblek:~ dshoop$ /Developer/Tools/GetFileInfo xyzzy2/file
file: "/Volumes/OoblekData/dshoop/xyzzy2/file"
type: ""
creator: ""
attributes: avbstclinmedz
created: 06/27/2006 14:57:15
modified: 06/27/2006 14:57:15


--

-dhan

------------------------------------------------------------------------
Dan Shoop                                                   AIM: iWiring
Systems & Networks Architect                      http://www.ustsvs.com/
email@hidden                                http://www.iwiring.net/
1-714-363-1174

pgp key fingerprint: FAC0 9434 B5A5 24A8 D0AF  12B1 7840 3BE7 3736 DE0B

iWiring provides systems and networks support for Mac OS X, unix, and
Open Source application technologies at affordable rates.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Metadata support
      • From: Axel Luttgens <email@hidden>
    • Re: Metadata support
      • From: "Jordan K. Hubbard" <email@hidden>
    • Re: Metadata support
      • From: maurits <email@hidden>
References: 
 >Metadata support (From: Tomas Zahradnicky <email@hidden>)
 >Re: Metadata support (From: Q <email@hidden>)
 >Re: Metadata support (From: Dan Shoop <email@hidden>)
 >Re: Metadata support (From: Boyd Waters <email@hidden>)
 >Re: Metadata support (From: "Jordan K. Hubbard" <email@hidden>)
 >Re: Metadata support (From: Dan Shoop <email@hidden>)
 >Re: Metadata support (From: "Jordan K. Hubbard" <email@hidden>)
 >Re: Metadata support (From: Dan Shoop <email@hidden>)
 >Re: Metadata support (From: maurits <email@hidden>)

  • Prev by Date: Re: Metadata support
  • Next by Date: Re: Metadata support
  • Previous by thread: Re: Metadata support
  • Next by thread: Re: Metadata support
  • Index(es):
    • Date
    • Thread