зеркало из https://github.com/mozilla/pjs.git
Bug 304160 - XULRunner build process on mac requires a special setuid program to change ownership of files to root, r=chase/preed
This commit is contained in:
Родитель
381f29262b
Коммит
6537d33c07
|
@ -0,0 +1,16 @@
|
|||
#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);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
return 1;
|
||||
|
||||
return execl("/usr/sbin/chown",
|
||||
"/usr/sbin/chown", "-R", "-h", "root:admin", argv[1], (char*) 0);
|
||||
}
|
Загрузка…
Ссылка в новой задаче