summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2017-04-21 11:50:32 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-06-27 14:52:50 +0300
commit5a4e6f38891d9ff1da7819df2b18971f6e539abe (patch)
tree57f717da07fb46fd5eff3bda74e17662a5a8b98b
parent440bb02fd771bad7389599d4c256e3f531f7b545 (diff)
downloadabuild-5a4e6f38891d9ff1da7819df2b18971f6e539abe.tar.gz
abuild-5a4e6f38891d9ff1da7819df2b18971f6e539abe.tar.bz2
abuild-5a4e6f38891d9ff1da7819df2b18971f6e539abe.tar.xz
abuild-5a4e6f38891d9ff1da7819df2b18971f6e539abe.zip
abuild-sudo: enforce correct value for USER
-rw-r--r--abuild-sudo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/abuild-sudo.c b/abuild-sudo.c
index 1e51b5d..c877e7a 100644
--- a/abuild-sudo.c
+++ b/abuild-sudo.c
@@ -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)