scp : Problems with pathing

Tuc tuc at ttsg.com
Sun Mar 31 04:48:30 EST 2002


> > > E-mail me privately your config.h, config.log and the configure
> > > command line you used. And what platform is this again?
> > >
> > 	BSD/OS, 4.0.1 and 4.1
> 
> Here is what's going on.
> Your config.h has
> #define HAVE_LOGIN_CAP_H 1
> #define HAVE_LOGIN_GETCAPBOOL 1
> --------< defines.h >-------
> #if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
> # define HAVE_LOGIN_CAP
> #endif
> ----------------------------
> -----< session.c >----- (edited)
> #ifdef HAVE_LOGIN_CAP
>                 (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH);
>                 child_set_env(&env, &envsize, "PATH", getenv("PATH"));
> #else /* HAVE_LOGIN_CAP */
>                 child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
> #endif /* HAVE_LOGIN_CAP */
> ---------------------------
> 
> So the path you want, "_PATH_STDPATH" will not be used.
> I'm not sure what to do about it. I have no BSD here.
> 
	Ok. So, then if I have HAVE_LOGIN_CAP_H, then it must be
picking up the getenv("PATH") of the user.  When I log on as the user, I
get :

MACHINE# su - USER
MACHINE:/usr/home/USER $ echo $PATH
/usr/home/./USER/bin:/bin:/usr/bin:/usr/X11/bin:/usr/contrib/bin:/usr/contrib/mh
/bin:/usr/games:/usr/local/bin
MACHINE:/usr/home/USER $ which scp
/usr/local/bin/scp


	Hrm, but I just realized, maybe there is .XXXrc fiddling with that.
Let me check what an ID with none of that has...

MACHINE# su - scptest
su-2.02$ echo $PATH
/bin:/usr/bin:/usr/contrib/bin:/usr/X11/bin

	Looks awfully familiar! I never tried the /usr/X11/bin, but something
tells me its fine.

	As for what to do about it, which would be better for it to do?
Abide by users path, or the compiled in path?  On BSD/OS, it seems to take
it from the /etc/login.conf before it gets modified by .XXXrc's.

# 
# The default values
# To alter the default authentication types change the line:
#       :tc=auth-bsdi-defaults:\
# to be read something like: (enables passwd, "myauth", and activ)
#       :auth=passwd,myauth,activ:\
# Any value changed in the daemon class should be reset in default
# class.
#
default:\
        :path=/bin /usr/bin /usr/contrib/bin /usr/X11/bin:\
        :datasize-cur=16M:\
        :maxproc-max=128:\
        :maxproc-cur=64:\
        :radius-challenge-styles=activ,crypto,skey,snk,token:\
        :tc=auth-bsdi-defaults:\
        :tc=auth-ftp-bsdi-defaults:


		Thanks for the help, atleast we know whats
happening!

		Thanks, Tuc/TTSG Internet Services, Inc.



More information about the openssh-unix-dev mailing list