Module Name: src
Committed By: christos
Date: Wed Feb 17 15:57:24 UTC 2010
Modified Files:
src/bin/sh: main.c
Log Message:
PR/42828: Richard Hansen: Don't evaluate ${ENV} if not interactive.
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/bin/sh/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/main.c
diff -u src/bin/sh/main.c:1.53 src/bin/sh/main.c:1.54
--- src/bin/sh/main.c:1.53 Sat Jan 17 19:30:54 2009
+++ src/bin/sh/main.c Wed Feb 17 10:57:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.53 2009/01/18 00:30:54 lukem Exp $ */
+/* $NetBSD: main.c,v 1.54 2010/02/17 15:57:24 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)main.c 8.7 (Berkeley) 7/19/95";
#else
-__RCSID("$NetBSD: main.c,v 1.53 2009/01/18 00:30:54 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.54 2010/02/17 15:57:24 christos Exp $");
#endif
#endif /* not lint */
@@ -184,7 +184,7 @@
}
state2:
state = 3;
- if (getuid() == geteuid() && getgid() == getegid()) {
+ if (iflag && getuid() == geteuid() && getgid() == getegid()) {
if ((shinit = lookupvar("ENV")) != NULL && *shinit != '\0') {
state = 3;
read_profile(shinit);