abuild-sudo.c: setgid as well

set our gid to root so apk commit hooks run with the same gid as when
running  "sudo apk add ..." from command line.
This commit is contained in:
Henrik Riomar 2017-05-15 23:06:21 +02:00 committed by William Pitcock
parent 79525de509
commit 5268ae8076

View File

@ -97,6 +97,8 @@ int main(int argc, const char *argv[])
argv[0] = path;
/* set our uid to root so bbsuid --install works */
setuid(0);
/* set our gid to root so apk commit hooks run with the same gid as for "sudo apk add ..." */
setgid(0);
execv(path, (char * const*)argv);
perror(path);
return 1;