summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2001-03-10 13:50:45 -0800
committerTim Rice <tim@multitalents.net>2001-03-10 13:50:45 -0800
commit59ea0a0efd273671167a58108532b3c48daa3573 (patch)
tree608bbf9cc63418f1b77a5ce98de502e2a2abaa4d
parentd20d0f3e27884c7daf9d48d335168898e147b65b (diff)
make sure $bindir is in USER_PATH so scp will work
-rw-r--r--Makefile.in5
-rw-r--r--configure.in60
-rw-r--r--sshd_config2
3 files changed, 63 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index c109e098..f4f77e9f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.157 2001/03/09 19:48:37 mouring Exp $
+# $Id: Makefile.in,v 1.158 2001/03/10 21:50:46 tim Exp $
prefix=@prefix@
exec_prefix=@exec_prefix@
@@ -68,7 +68,8 @@ PATHSUBS = \
-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)
diff --git a/configure.in b/configure.in
index 176e3b4b..9edb6ac6 100644
--- a/configure.in
+++ b/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.262 2001/03/08 18:26:57 stevesk Exp $
+# $Id: configure.in,v 1.263 2001/03/10 21:50:45 tim Exp $
AC_INIT(ssh.c)
@@ -1418,11 +1418,65 @@ AC_ARG_WITH(default-path,
[ --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
+ ],
+ [
+ AC_TRY_RUN(
+ [
+/* find out what STDPATH is */
+#include <stdio.h>
+#include "config.h"
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+#endif
+#ifndef _PATH_STDPATH
+# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#define DATA "conftest.stdpath"
+
+main()
+{
+ FILE *fd;
+ int rc;
+
+ fd = fopen(DATA,"w");
+ if(fd == NULL)
+ exit(1);
+
+ if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
+ exit(1);
+
+ exit(0);
+}
+ ], [ user_path=`cat conftest.stdpath` ],
+ [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
+ [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
+ )
+# 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"
@@ -1779,6 +1833,7 @@ D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
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."
@@ -1788,6 +1843,7 @@ echo " Configuration files: $D"
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}"
diff --git a/sshd_config b/sshd_config
index 0e297007..c122558b 100644
--- a/sshd_config
+++ b/sshd_config
@@ -1,5 +1,7 @@
# $OpenBSD: sshd_config,v 1.34 2001/02/24 10:37:26 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.