Date: Tue, 30 Jan 2001 10:42:18 -0500 From: "Patrick Bihan-Faou" <patrick@netzuno.com> To: <chet@po.CWRU.Edu>, <roam@orbitel.bg> Cc: <freebsd-hackers@freebsd.org> Subject: RE: Bash2 removes SSH_CLIENT from the environment Message-ID: <HJEEKLMFLKEOKHOKNPBMEEJICJAA.patrick@netzuno.com> In-Reply-To: <1010130150609.AA70020.SM@nike.INS.CWRU.Edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, > 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. This is what I figured from reading the code, however not exporting SSH_CLIENT is not enough to really achieve this goal: bash looks for either SSH_CLIENT or SSH2_CLIENT to determine if it should run the startup scripts, but only SSH_CLIENT is cleared. Also the content of SSH_CLIENT may be of intereset (namely the remote IP) and I don't know how to retrieve that information after SSH_CLIENT has been clobbered. It seems to me that this is a hack that could have been easily avoided by using the value of SHLVL: if it is greater than 1, there is no need to re-execute the startup script... I'd be willing to implement this fix if people are interested in it. (note the discussion is only on freebsd-hackers from now on) Patrick. 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?HJEEKLMFLKEOKHOKNPBMEEJICJAA.patrick>