diff --git a/usr.bin/su/su.1 b/usr.bin/su/su.1 index 26eb2c0d4ca2..d5aa8220d9fb 100644 --- a/usr.bin/su/su.1 +++ b/usr.bin/su/su.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)su.1 8.2 (Berkeley) 4/18/94 -.\" $NetBSD: su.1,v 1.28 2003/02/25 10:35:56 wiz Exp $ +.\" $NetBSD: su.1,v 1.29 2003/04/20 20:13:20 christos Exp $ .\" .Dd January 19, 2003 .Dt SU 1 @@ -106,6 +106,14 @@ If the invoked shell is this option prevents it from reading the .Dq Pa .cshrc file. +If the invoked shell is +.Xr sh 1 , +or +.Xr ksh 1 , +this option unsets +.Ev ENV , +thus preventing the shell from executing the startup file pointed to by +this variable. .It Fl l Simulate a full login. The environment is discarded except for diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index de549d333db0..c9481273dcfb 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -1,4 +1,4 @@ -/* $NetBSD: su.c,v 1.51 2002/11/16 15:59:31 itojun Exp $ */ +/* $NetBSD: su.c,v 1.52 2003/04/20 20:13:20 christos Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -44,7 +44,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/ #else -__RCSID("$NetBSD: su.c,v 1.51 2002/11/16 15:59:31 itojun Exp $"); +__RCSID("$NetBSD: su.c,v 1.52 2003/04/20 20:13:20 christos Exp $"); #endif #endif /* not lint */ @@ -356,6 +356,8 @@ badlogin: *np-- = "-f"; if (asme) *np-- = "-m"; + } else { + unsetenv("ENV"); } if (asthem) {