Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2001 10:06:09 -0500
From:      Chet Ramey <chet@nike.INS.CWRU.Edu>
To:        roam@orbitel.bg
Cc:        patrick@netzuno.com, freebsd-hackers@freebsd.org, freebsd-security@freebsd.org, chet@po.cwru.edu
Subject:   Re: Bash2 removes SSH_CLIENT from the environment
Message-ID:  <1010130150609.AA70020.SM@nike.INS.CWRU.Edu>

next in thread | raw e-mail | index | archive | help
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1010130150609.AA70020.SM>