mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-02 18:27:26 +00:00
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.
This commit is contained in:
parent
c7d94591a5
commit
a1baec0f6b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user