From owner-freebsd-hackers Tue Jan 30 7:10:14 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from garnet.INS.CWRU.Edu (garnet.INS.CWRU.Edu [129.22.8.233]) by hub.freebsd.org (Postfix) with ESMTP id 0D11037B65D; Tue, 30 Jan 2001 07:09:54 -0800 (PST) Received: from nike.INS.CWRU.Edu (nike.INS.CWRU.Edu [129.22.8.219]) by garnet.INS.CWRU.Edu with SMTP (8.8.8+cwru/CWRU-3.6) id KAA24833; Tue, 30 Jan 2001 10:09:41 -0500 (EST) (from chet@nike.INS.CWRU.Edu) Date: Tue, 30 Jan 2001 10:06:09 -0500 From: Chet Ramey To: roam@orbitel.bg Subject: Re: Bash2 removes SSH_CLIENT from the environment Cc: patrick@netzuno.com, freebsd-hackers@freebsd.org, freebsd-security@freebsd.org, chet@po.cwru.edu Reply-To: chet@po.CWRU.Edu Message-ID: <1010130150609.AA70020.SM@nike.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-In-Reply-To: Message from roam@orbitel.bg of Tue, 30 Jan 2001 10:34:16 +0200 (id <20010130103415.B328@ringworld.oblivion.bg>) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > However I found that if the login shell of the user is set to bash (version > > 2.03 or 2.04 at least), this variable is never set. Upon inspection of the > > code for bash, it appears that bash is explicitely removing the definition > > of this environment variable. Would anybody have an idea why ??? > > > > Also the fix to leave SSH_CLIENT defined is trivial, is that something that > > would be desirable for the bash2 port ? > > Huh? Bash uses the presence of SSH_CLIENT to decide whether or not to run the shell startup files for a non-interactive shell (like it attempts to do for rsh). The problem is that if the variable is exported, subsequent invocations of non-interactive shells will source the startup files. A lot of users find the former behavior desirable, and the latter undesirable. The tradeoff bash makes is to remove the export attribute from SSH_CLIENT if it exists in the shell's initial environment. Users may always export it explicitly. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet) Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message