From owner-freebsd-hackers Thu May 1 05:08:39 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA20444 for hackers-outgoing; Thu, 1 May 1997 05:08:39 -0700 (PDT) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA20421 for ; Thu, 1 May 1997 05:08:35 -0700 (PDT) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by who.cdrom.com (8.8.5/8.6.11) with ESMTP id BAA10363 for ; Thu, 1 May 1997 01:02:01 -0700 (PDT) Received: from awfulhak.demon.co.uk (localhost.lan.awfulhak.org [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id IAA25335; Thu, 1 May 1997 08:57:09 +0100 (BST) Message-Id: <199705010757.IAA25335@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: Andrew Gierth cc: hackers@freebsd.org Subject: Re: /bin/sh -c and ENV In-reply-to: Your message of "01 May 1997 06:23:19 BST." <87rafr6a0o.fsf@erlenstar.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 May 1997 08:57:09 +0100 From: Brian Somers Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Running RELENG-2.2 as of a few days ago. > > Just noticed that /bin/sh is executing the ENV file even when invoked with > the -c option. Is this a bug or a feature? :-) > > (Executing the ENV file in calls to system(3) or popen(3) could be considered > a Bad Thing, even in non-suid programs, and the last system I used where > system and popen invoked a Posix shell specifically disabled the ENV file > if the -c option was used.) This is correct behaviour. RTFM (I hear the masses: WHAT ? FOR SH ?) There's an example in the man page of how to write ENV files for interactive use only. > -- > Andrew. -- Brian , Don't _EVER_ lose your sense of humour....