_PATH_STDPATH and @bindir@

Tim Rice tim at multitalents.net
Wed Feb 21 08:49:28 EST 2001


On Mon, 19 Feb 2001, Michael Han wrote:

> I'm curious to know why Portable OpenSSH doesn't include @bindir@ in
> the _PATH_STDPATH. This would save most installers of portable OpenSSH
> from having to --with-default-path=$PREFIX/bin in order to ensure that
> scp will work properly. This would also, I imagine, save quite a lot
> of hassle for developers/helpful-folks on the mailing list regarding
> FAQ 3.7. I could suggest a patch to do this, but figure you all know a
> better way than I'd suggest.

Here is a patch that will do waht you want.

> 
> Actually, might it not be better to have the server path be a run-time
> configurable option, rather than a build-time option? Anyway, at the
> very least, it'd be nice if the default installation weren't broken.
> 

-- 
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