summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2017-05-15 23:06:21 +0200
committerWilliam Pitcock <nenolod@dereferenced.org>2017-06-21 18:14:48 +0000
commit5268ae8076d2e46a5495017b787c12fc1bcf1703 (patch)
treef253583e9eb1c0f193e3ca73941066c624d08459
parent79525de509ccb107e388c5f4d5bb700b2d1e8831 (diff)
downloadabuild-5268ae8076d2e46a5495017b787c12fc1bcf1703.tar.gz
abuild-5268ae8076d2e46a5495017b787c12fc1bcf1703.tar.bz2
abuild-5268ae8076d2e46a5495017b787c12fc1bcf1703.tar.xz
abuild-5268ae8076d2e46a5495017b787c12fc1bcf1703.zip
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.
-rw-r--r--abuild-sudo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/abuild-sudo.c b/abuild-sudo.c
index 7b6235a..9377756 100644
--- a/abuild-sudo.c
+++ b/abuild-sudo.c
@@ -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;