HP-UX /etc/PATH

Stuart Craig scraig at eli.net
Fri Aug 25 02:08:16 EST 2000


Lutz Jaenicke wrote:
> 
> On Wed, Aug 23, 2000 at 04:57:01PM -0700, Stuart Craig wrote:
> > Attached to this message is a patch I made against 2.1.1p4 for HP-UX
> > which causes sshd to set the PATH variable from /etc/PATH.  This is the
> > usual practice under HP-UX 10.20 and HP-UX 11.  I activated the patch by
> > calling configure like so:
> >
> > ./configure --with-cflags=-DHAVE_ETC_PATH ...
> >
> > This should be done in configure instead, but I haven't installed
> > autoconf.
> 
> /etc/PATH is read by /etc/csh.login or /etc/profile, respectively.
> My (may be personal) problem is that I only have the "system PATH"
> as automatically be set during swinstall processes in /etc/PATH,
> my additional settings are in /usr/local/etc/PATH which is sourced
> later from my (changed) /etc/csh.login or /etc/profile files.
> (And, of course, /usr/local/openssh/bin is on /usr/local/etc/PATH :-)
> [This solution is easier to maintain as I have a common /usr/local that
> is distributed via rdist (over ssh, of course :-), while /etc/PATH can
> be different for the individual hosts with respect to the installed software.]

I added this patch because /etc/PATH is read by /etc/csh.login and
/etc/profile, but neither of these get executed if you use ssh for
remote command execution.  To see the difference, compare the path you
see with "ssh <hp-host> env" with the path you see when you ssh to
<hp-host> and then run env in an interactive shell.  It sounds like you
have gotten around that problem by specifying a more complete default
PATH to configure.  I didn't want to do it that way because I've got
more than 80 HP systems with a very random mix of installed applications
-- most of them have different system PATH settings.

> That won't hurt anybody, if (there is always an if :-) your patch would
> not overwrite the PATH that was compiled in by setting the
> "--with-default-path=..." switch.
> Do you think it would be appropriate to concatenate the default path compiled
> in _and_ /etc/PATH? Probably we would get doubled entries.

I don't have a problem with modifying the patch to concatenate the two
PATHs.  I almost did it that way in the first place.  The question is,
do I put the compiled in default PATH first, or last?  I'm leaning
towards first.

Maybe what is really needed is a simple way, using configure, to specify
one or more arbitrary files to read for PATH and other environment
variable information.  You've got to admit that the current set of files
that gets looked at, on various platforms, is pretty much a random
jumble.

 - Stu

--
Stuart J. Craig <scraig at eli.net>
Senior UNIX Administrator
Electric Lightwave, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2515 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20000824/24b981fe/attachment.bin 


More information about the openssh-unix-dev mailing list