Re: copyfile(3) copies the posix "owner" for *some* files only
Re: copyfile(3) copies the posix "owner" for *some* files only
- Subject: Re: copyfile(3) copies the posix "owner" for *some* files only
- From: Chris Suter <email@hidden>
- Date: Mon, 26 Jul 2010 10:31:05 +1000
Hi Jerry,
On Sun, Jul 25, 2010 at 1:09 PM, Jerry Krinock
<email@hidden> wrote:
I'm using copyfile(3) in a privileged helper tool to copy files between Mac user accounts. Regarding the posix file "owner", i.e. the "jk 501" in this ls output:
-rw-r--r-- 1 jk 501 0 Sep 11 2008 Hello.txt
I see that, for some files, the copied file's owner is consistently that of its version in the source, and for others, it is consistently the user ID of the helper tool. I haven't figured out a pattern yet.
The man page copyfile(3) does not mention the file's owner, although it does say there is a flag to copy the "POSIX information (mode, modification time, etc.)", which I have set.
Is the POSIX owner included in "etc."? Has anyone ever seen this not work?
COPYFILE_STAT should copy the owner, but you might also need to pass COPYFILE_ACL; it's possible that it's failing when it encounters a file with an ACL.
By the way, the copyfile is open source.
Kind regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden