add scp path to _PATH_STDPATH

Tim Rice tim at multitalents.net
Sun Feb 18 13:54:10 EST 2001


Try this patch out.

In addition to the things mentioned below, it adds a line
to sshd_config telling what PATH was compiled into sshd.

On Tue, 13 Feb 2001, Tim Rice wrote:

> On Tue, 13 Feb 2001, Kevin Steves wrote:
> 
> > On Tue, 13 Feb 2001, Tim Rice wrote:
> > : I have a good patch in my 2.2.0p1 code that I can bring forward.
> > : I probably will not be able to work on it until the weekend.
> > 
> > how was it different from the patch i posted?
> > 
> [patch snipped]
> > 
> It sets the default patch to be same as rshd (on platforms I know)
> It only adds to the PATH if the path to scp is not in PATH.
> And it displays what the PATH is going to be at the end of configure.
> And it works correctly if you chang any of these.
>   --prefix=PREFIX         install architecture-independent files in PREFIX
>   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
>   --bindir=DIR            user executables in DIR [EPREFIX/bin]
>   --with-default-path=PATH Specify default $PATH environment for server
> 

-- 
Tim Rice				Multitalents	(707) 887-1469
tim at multitalents.net

-------------- next part --------------
--- openssh_cvs/configure.in.old	Fri Feb 16 18:15:18 2001
+++ openssh_cvs/configure.in	Sat Feb 17 18:42:19 2001
@@ -46,6 +46,9 @@
 	CFLAGS="$CFLAGS -Wall"
 fi
 
+# taken from defines.h
+user_path="/usr/bin:/bin:/usr/sbin:/sbin"
+
 # Check for some target-specific stuff
 case "$host" in
 *-*-aix*)
@@ -170,6 +173,7 @@
 	else
 		AC_MSG_RESULT(no)
 	fi
+	user_path="/usr/sbin:/usr/bin"
 	;;
 *-*-sunos4*)
 	CPPFLAGS="$CPPFLAGS -DSUNOS4"
@@ -206,6 +210,7 @@
 	mansubdir=cat
 	enable_suid_ssh=no
 	AC_DEFINE(USE_PIPES)
+	user_path=":/bin:/usr/bin:/usr/X/bin"
 	;;
 *-*-sysv5*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -214,6 +219,7 @@
 	mansubdir=cat
 	enable_suid_ssh=no
 	AC_DEFINE(USE_PIPES)
+	user_path=":/bin:/usr/bin:/usr/X/bin"
 	;;
 *-*-sysv*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -237,6 +243,7 @@
 	AC_DEFINE(DISABLE_SHADOW)
 	AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
 	AC_CHECK_FUNCS(getluid setluid)
+	user_path="/bin:/usr/bin:/usr/local/bin:"
 	;;
 *-*-sco3.2v5*)
 	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -251,6 +258,7 @@
 	AC_DEFINE(DISABLE_SHADOW)
 	AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H)
 	AC_CHECK_FUNCS(getluid setluid)
+	user_path="/bin:/usr/bin:/etc"
 	;;
 *-dec-osf*)
 	if test ! -z "USE_SIA" ; then
@@ -1366,12 +1377,31 @@
 	[  --with-default-path=PATH Specify default \$PATH environment for server],
 	[
 		if test "x$withval" != "xno" ; then	
-			AC_DEFINE_UNQUOTED(USER_PATH, "$withval")
+			user_path="$withval"
 			SERVER_PATH_MSG="$withval" 
 		fi
 	]
 )
 
+# make sure $bindir is in USER_PATH so scp will work
+t_bindir=`eval echo ${bindir}`
+case $t_bindir in
+	NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
+esac
+case $t_bindir in
+	NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
+esac
+echo $user_path | grep ":$t_bindir"  > /dev/null 2>&1
+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)
+	fi
+fi
+AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
+AC_SUBST(user_path)
+
 # Whether to force IPv4 by default (needed on broken glibc Linux)
 IPV4_HACK_MSG="no" 
 AC_ARG_WITH(ipv4-default,
@@ -1714,6 +1744,7 @@
 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
+H=`eval echo ${user_path}` ; H=`eval echo ${H}`
 
 echo ""
 echo "OpenSSH configured has been configured with the following options."
@@ -1723,6 +1754,7 @@
 echo "               Askpass program: $E"
 echo "                  Manual pages: $F"
 echo "                      PID file: $G"
+echo "        sshd default user PATH: $H"
 echo "      Random number collection: $RAND_MSG"
 echo "                Manpage format: $MAN_MSG"
 echo "                   PAM support: ${PAM_MSG}"
--- openssh_cvs/Makefile.in.old	Fri Feb 16 18:15:07 2001
+++ openssh_cvs/Makefile.in	Sat Feb 17 18:42:37 2001
@@ -68,7 +68,8 @@
 	-D/var/run/sshd.pid=$(piddir)/sshd.pid \
 	-D/etc/primes=$(sysconfdir)/primes \
 	-D/etc/sshrc=$(sysconfdir)/sshrc \
-	-D/usr/X11R6/bin/xauth=$(XAUTH_PATH)
+	-D/usr/X11R6/bin/xauth=$(XAUTH_PATH) \
+	-D/usr/bin:/bin:/usr/sbin:/sbin=@user_path@
 
 FIXPATHSCMD	= $(PERL) $(srcdir)/fixpaths $(PATHSUBS)
 
--- openssh_cvs/sshd_config.old	Sat Feb 10 19:40:00 2001
+++ openssh_cvs/sshd_config	Sat Feb 17 18:29:35 2001
@@ -1,5 +1,7 @@
 #	$OpenBSD: sshd_config,v 1.32 2001/02/06 22:07:50 deraadt Exp $
 
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
 # This is the sshd server system-wide configuration file.  See sshd(8)
 # for more information.
 


More information about the openssh-unix-dev mailing list