set LOGNAME for POSIX.2
[unix-history] / usr / src / usr.bin / login / login.c
index 75df5cf..a8cd09c 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)login.c    5.71 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c    5.72 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -391,6 +391,7 @@ main(argc, argv)
        if (term[0] == '\0')
                strncpy(term, stypeof(tty), sizeof(term));
        (void)setenv("TERM", term, 0);
        if (term[0] == '\0')
                strncpy(term, stypeof(tty), sizeof(term));
        (void)setenv("TERM", term, 0);
+       (void)setenv("LOGNAME", pwd->pw_name, 1);
        (void)setenv("USER", pwd->pw_name, 1);
        (void)setenv("PATH", _PATH_DEFPATH, 0);
 #ifdef KERBEROS
        (void)setenv("USER", pwd->pw_name, 1);
        (void)setenv("PATH", _PATH_DEFPATH, 0);
 #ifdef KERBEROS