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: Wed, 28 Jul 2010 18:41:40 -0700
On 2010 Jul 25, at 16:01, Jerry Krinock wrote:
> I added some code in my tool to call chown(3) after copyfile(3), and of course that fixes the unpredictability.
But this leaves me with one more nasty wrinkle. If I use copyfile(3) on a directory tree, recursively, then, duh, I need to chown this tree recursively also.
Unfortunately, although the shell command chown(8) sports a handy -R "recursive" option, there is no such option in the C library function chown(3). I think that my unpleasant choices are to either write a recursion around chown(3) using the fts_ family of functions {fts_open(), fts_read(), ...}, or else access the shell using system() to call chown(8) with -R option.
The former option will take me awhile, and of the latter, I suspect that the people at Apple CDSA will tell me that it's insecure to make a shell call in a privileged helper tool. I don't know why. I just know they probably will ;)
Any advice?
_______________________________________________
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