From 8752bdfe89d3a287560a9c94db78a5685763dfda Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 17 Feb 2010 15:57:24 +0000 Subject: [PATCH] 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 --- bin/sh/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/sh/main.c b/bin/sh/main.c index 597d2a111cb3..12c19793985f 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #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 @@ state1: } 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);