From: Todd C. Miller Date: Mon, 3 May 1999 16:00:32 +0000 (+0000) Subject: set $LOGNAME when we set $USER X-Git-Tag: SUDO_1_6_0~281 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b91a87a9fe868fea1dc341507270a584666a880;p=sudo set $LOGNAME when we set $USER --- diff --git a/sudo.c b/sudo.c index 343b84820..56cc7570c 100644 --- a/sudo.c +++ b/sudo.c @@ -997,13 +997,19 @@ set_perms(perm, sudo_mode) exit(1); } - /* Set $USER to match target user */ + /* Set $USER and $LOGNAME to target user */ if (sudo_setenv("USER", pw->pw_name)) { (void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]); exit(1); } + if (sudo_setenv("LOGNAME", pw->pw_name)) { + (void) fprintf(stderr, + "%s: cannot allocate memory!\n", + Argv[0]); + exit(1); + } if (setgid(pw->pw_gid)) { (void) fprintf(stderr,