From owner-freebsd-security Tue Jan 30 0:36:56 2001 Delivered-To: freebsd-security@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.189]) by hub.freebsd.org (Postfix) with SMTP id 1EEB037B698 for ; Tue, 30 Jan 2001 00:36:10 -0800 (PST) Received: (qmail 2054 invoked by uid 1000); 30 Jan 2001 08:34:17 -0000 Date: Tue, 30 Jan 2001 10:34:16 +0200 From: Peter Pentchev To: Patrick Bihan-Faou Cc: freebsd-hackers@freebsd.org, freebsd-security@freebsd.org Subject: Re: Bash2 removes SSH_CLIENT from the environment Message-ID: <20010130103415.B328@ringworld.oblivion.bg> Mail-Followup-To: Patrick Bihan-Faou , freebsd-hackers@freebsd.org, freebsd-security@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from patrick@netzuno.com on Mon, Jan 29, 2001 at 03:09:30PM -0500 Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, Jan 29, 2001 at 03:09:30PM -0500, Patrick Bihan-Faou wrote: > Hi, > > I am writing some script that looks for the SSH_CLIENT environment variable. > As specified in the sshd(8) man page, this variable should contain the IP > address of the client, the port number on the client side and the port > number on the server side. > > 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? [roam@ringworld:v2 ~]$ ssh roam@localhost '/bin/echo "shell is $BASH_VERSION, SSH_CLIENT is $SSH_CLIENT"' roam@localhost.office1's password: shell is 2.04.0(1)-release, SSH_CLIENT is 127.0.0.1 1075 22 [roam@ringworld:v2 ~]$ This is on 4.2-stable with bash installed from the shells/bash2 port. Are you sure you don't have anything in your profiles that unsets unknown variables or something? G'luck, Peter -- .siht ekil ti gnidaer eb d'uoy ,werbeH ni erew ecnetnes siht fI To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message