]> granicus.if.org Git - sudo/commitdiff
set $LOGNAME when we set $USER
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 May 1999 16:00:32 +0000 (16:00 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 May 1999 16:00:32 +0000 (16:00 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index 343b84820f0f0261fb6a24840a44a01dcd10347d..56cc7570cd5a9f7e5115addc468d77d0faf93932 100644 (file)
--- 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,