=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/su/su.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/su/su.c 1996/10/23 01:28:57 1.14 --- src/usr.bin/su/su.c 1996/10/26 03:19:31 1.15 *************** *** 1,4 **** ! /* $OpenBSD: su.c,v 1.14 1996/10/23 01:28:57 millert Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: su.c,v 1.15 1996/10/26 03:19:31 millert Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. *************** *** 41,47 **** #ifndef lint /*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/ ! static char rcsid[] = "$OpenBSD: su.c,v 1.14 1996/10/23 01:28:57 millert Exp $"; #endif /* not lint */ #include --- 41,47 ---- #ifndef lint /*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/ ! static char rcsid[] = "$OpenBSD: su.c,v 1.15 1996/10/26 03:19:31 millert Exp $"; #endif /* not lint */ #include *************** *** 241,248 **** seteuid(0); setegid(0); /* XXX use a saved gid instead? */ } ! if (asthem || pwd->pw_uid) (void)setenv("USER", pwd->pw_name, 1); (void)setenv("HOME", pwd->pw_dir, 1); (void)setenv("SHELL", shell, 1); } --- 241,250 ---- seteuid(0); setegid(0); /* XXX use a saved gid instead? */ } ! if (asthem || pwd->pw_uid) { ! (void)setenv("LOGNAME", pwd->pw_name, 1); (void)setenv("USER", pwd->pw_name, 1); + } (void)setenv("HOME", pwd->pw_dir, 1); (void)setenv("SHELL", shell, 1); }