benjamin%smedbergs.us 3345285d8e Bug 304160 - XULRunner build process on mac requires a special setuid program to change ownership of files to root, r=chase/preed
git-svn-id: svn://10.0.0.236/trunk@208204 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-23 18:16:29 +00:00

17 lines
339 B
C

#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
if (argc != 2)
return 1;
uid_t realuser = getuid();
char uidstring[20];
snprintf(uidstring, 19, "%i", realuser);
uidstring[19] = '\0';
return execl("/usr/sbin/chown",
"/usr/sbin/chown", "-R", "-h", uidstring, argv[1], (char*) 0);
}