Re: scp pathing help with f secure and open ssh

From: Darren Tucker (dtucker_at_dodgy.net.au)
Date: 02/25/04


Date: Wed, 25 Feb 2004 12:31:04 +0000 (UTC)

In article <b71c089b.0402241932.59ba7fd8@posting.google.com>,
Kirk <kirkbecnel@comcast.net> wrote:
>I have a need to run both f secure ssh and open ssh on the same host.
>I also need to be able to point an incoming scp request to the proper
>scp binary on the server with both versions.
>
>I have compiled openssh with the default path option, and it is still
>going to /usr/bin, even though my default path says to go where the
>binary actually is.
>
>Both server and client are AIX machines. It appears the path is being
>generated by /etc/environment.

Yep, /etc/environment overrides the compile-time defaults (the reasoning
being that run-time configuration by the admin of the server should take
precedence over that of the package builder).

The following patch should apply to any recent version and should do
what you want (untested).

diff -u -p -r1.275 session.c
--- session.c 23 Feb 2004 13:01:27 -0000 1.275
+++ session.c 25 Feb 2004 12:26:13 -0000
@@ -1084,6 +1084,11 @@ do_setup_env(Session *s, const char *she
                read_environment_file(&env, &envsize, "/etc/environment");
        }
 #endif
+ if (path == NULL || *path == '\0') {
+ child_set_env(&env, &envsize, "PATH",
+ s->pw->pw_uid == 0 ?
+ SUPERUSER_PATH : _PATH_STDPATH);
+ }
 #ifdef KRB5
        if (s->authctxt->krb5_ticket_file)
                child_set_env(&env, &envsize, "KRB5CCNAME",

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.