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: Jerry Krinock <email@hidden>
- Date: Sun, 25 Jul 2010 16:01:37 -0700
On 2010 Jul 24, at 23:40, Michael Smith wrote:
> Who are you copying as? Only root can assign ownership (as opposed to taking ownership, which is intrinsic for new files, and can be granted with an ACL).
OK, well, maybe whomever wrote copyfile(3) wasn't really thinking about what would happen if it was used in a (root?)-privileged helper tool like mine, and thus the behavior is unpredictable.
So, following my grandmother's advice of "If it isn't precisely documented, don't rely on it", I added some code in my tool to call chown(3) after copyfile(3), and of course that fixes the unpredictability.
Thanks, Michael.
_______________________________________________
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