mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-31 19:32:06 +00:00
abuild-sudo: enforce correct value for USER
This commit is contained in:
parent
440bb02fd7
commit
5a4e6f3889
@ -74,11 +74,12 @@ int main(int argc, const char *argv[])
|
||||
if (grent == NULL)
|
||||
errx(1, "%s: Group not found", ABUILD_GROUP);
|
||||
|
||||
char *name = getlogin();
|
||||
if (!is_in_group(grent->gr_gid)) {
|
||||
char *name = getlogin();
|
||||
errx(1, "User %s is not a member of group %s\n",
|
||||
name ? name : "(unknown)", ABUILD_GROUP);
|
||||
}
|
||||
setenv("USER", name, 1);
|
||||
|
||||
cmd = strrchr(argv[0], '/');
|
||||
if (cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user