diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-16 10:21:28 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-16 10:21:28 +0000 |
commit | a1baec0f6b96f7735c94d2f663b3dc4f26f9aaaa (patch) | |
tree | 3768094e0e4a984ace767040f1a62ed5cca10301 /abuild-sudo.c | |
parent | c7d94591a55d1d05a45281a849cd57d8d6c7d9d6 (diff) | |
download | abuild-a1baec0f6b96f7735c94d2f663b3dc4f26f9aaaa.tar.gz abuild-a1baec0f6b96f7735c94d2f663b3dc4f26f9aaaa.tar.bz2 abuild-a1baec0f6b96f7735c94d2f663b3dc4f26f9aaaa.tar.xz abuild-a1baec0f6b96f7735c94d2f663b3dc4f26f9aaaa.zip |
abuild-sudo: forbid use of --allow-untrusted
It means that home built packages cannot be installed with abuild-apk
unless the key is installed system-wide.
Diffstat (limited to 'abuild-sudo.c')
-rw-r--r-- | abuild-sudo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/abuild-sudo.c b/abuild-sudo.c index 2f34f3d..f3479fc 100644 --- a/abuild-sudo.c +++ b/abuild-sudo.c @@ -68,6 +68,7 @@ int main(int argc, const char *argv[]) struct group *grent; const char *cmd; const char *path; + int i; grent = getgrnam(ABUILD_GROUP); if (grent == NULL) @@ -85,6 +86,11 @@ int main(int argc, const char *argv[]) if (path == NULL) errx(1, "%s: Not a valid subcommand", cmd); + /* we dont allow --allow-untrusted option */ + for (i = 1; i < argc; i++) + if (strcmp(argv[i], "--allow-untrusted") == 0) + errx(1, "%s: not allowed option", "--allow-untrusted"); + argv[0] = path; /* set our uid to root so bbsuid --install works */ setuid(0); |