Re: copyfile(3) copies the posix "owner" for *some* files only
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jerry Krinock