Prepend bindir path to user path in configure.ac

Chris Rapier rapier at psc.edu
Tue Jul 14 05:03:17 AEST 2026


Howdy,

In the event that a user has multiple installation of OpenSSH the sshd 
process will use the the system default path to scp before the one in 
it's installation directory. For example, if someone is testing a new 
version of OpenSSH and installs it to /opt/test scp connections to that 
server will use the scp in /usr/bin before the one in /opt/test/bin/. 
This is because configure.ac appends the bindir path instead of 
prepending it.

The following should resolve that problem. This won't fix every 
potential problem with the path but it should cover a lot of them. 
Tested with 10.4p1.

Chris

diff --git a/configure.ac b/configure.ac
index c58016d32..5f7c6f694 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5640,8 +5640,8 @@ otherwise scp will not work.])
                 if test $? -ne 0  ; then
                         echo $user_path | grep "^$t_bindir"  > 
/dev/null 2>&1
                         if test $? -ne 0  ; then
-                               user_path=$user_path:$t_bindir
-                               AC_MSG_RESULT([Adding $t_bindir to 
USER_PATH so scp will work])
+                               user_path=$t_bindir:$user_path
+                               AC_MSG_RESULT([Prepending $t_bindir to 
USER_PATH so scp will work])
                         fi
                 fi
         fi ]


More information about the openssh-unix-dev mailing list