summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-05-13 10:48:57 +1000
committerDamien Miller <djm@mindrot.org>2002-05-13 10:48:57 +1000
commita18bbd398e053acb58a79a2b4e0f13b4db8a0bae (patch)
tree0d570609b81ffd0217ce20c46058d3cdad593d72
parent802b9568686032c81e4a998dc282df6ed63d4090 (diff)
- (djm) Add --with-superuser-path=xxx configure option to specify what $PATH
the superuser receives.
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac19
-rw-r--r--session.c5
3 files changed, 28 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b617a79ef..c4e583fe1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120020513
2 - (djm) Add --with-superuser-path=xxx configure option to specify what $PATH
3 the superuser receives.
4
120020511 520020511
2 - (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch. 6 - (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch.
3 Now only searches system and /usr/local/ssl (OpenSSL's default install path) 7 Now only searches system and /usr/local/ssl (OpenSSL's default install path)
@@ -567,4 +571,4 @@
567 - (stevesk) entropy.c: typo in debug message 571 - (stevesk) entropy.c: typo in debug message
568 - (djm) ssh-keygen -i needs seeded RNG; report from markus@ 572 - (djm) ssh-keygen -i needs seeded RNG; report from markus@
569 573
570$Id: ChangeLog,v 1.2106 2002/05/11 22:30:04 tim Exp $ 574$Id: ChangeLog,v 1.2107 2002/05/13 00:48:57 djm Exp $
diff --git a/configure.ac b/configure.ac
index 637b14e40..1b8aa5e1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.56 2002/05/11 20:17:44 tim Exp $ 1# $Id: configure.ac,v 1.57 2002/05/13 00:48:58 djm Exp $
2 2
3AC_INIT 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c]) 4AC_CONFIG_SRCDIR([ssh.c])
@@ -2011,6 +2011,19 @@ if test "$USES_LOGIN_CONF" != "yes" ; then
2011 AC_SUBST(user_path) 2011 AC_SUBST(user_path)
2012fi 2012fi
2013 2013
2014# Set superuser path separately to user path
2015MD5_MSG="no"
2016AC_ARG_WITH(superuser-path,
2017 [ --with-superuser-path= Specify different path for super-user],
2018 [
2019 if test "x$withval" != "xno" ; then
2020 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2021 superuser_path=$withval
2022 fi
2023 ]
2024)
2025
2026
2014# Whether to force IPv4 by default (needed on broken glibc Linux) 2027# Whether to force IPv4 by default (needed on broken glibc Linux)
2015IPV4_HACK_MSG="no" 2028IPV4_HACK_MSG="no"
2016AC_ARG_WITH(ipv4-default, 2029AC_ARG_WITH(ipv4-default,
@@ -2351,6 +2364,7 @@ E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2351F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` 2364F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2352G=`eval echo ${piddir}` ; G=`eval echo ${G}` 2365G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2353H=`eval echo ${user_path}` ; H=`eval echo ${H}` 2366H=`eval echo ${user_path}` ; H=`eval echo ${H}`
2367I=`eval echo ${superuser_path}` ; I=`eval echo ${I}`
2354 2368
2355echo "" 2369echo ""
2356echo "OpenSSH has been configured with the following options:" 2370echo "OpenSSH has been configured with the following options:"
@@ -2365,6 +2379,9 @@ echo " At runtime, sshd will use the path defined in /etc/login.conf"
2365else 2379else
2366echo " sshd default user PATH: $H" 2380echo " sshd default user PATH: $H"
2367fi 2381fi
2382if test ! -z "$superuser_path" ; then
2383echo " sshd superuser user PATH: $I"
2384fi
2368echo " Manpage format: $MANTYPE" 2385echo " Manpage format: $MANTYPE"
2369echo " PAM support: ${PAM_MSG}" 2386echo " PAM support: ${PAM_MSG}"
2370echo " KerberosIV support: $KRB4_MSG" 2387echo " KerberosIV support: $KRB4_MSG"
diff --git a/session.c b/session.c
index 20e6a889f..10d803e98 100644
--- a/session.c
+++ b/session.c
@@ -871,7 +871,12 @@ do_setup_env(Session *s, const char *shell)
871 * needed for loading shared libraries. So the path better 871 * needed for loading shared libraries. So the path better
872 * remains intact here. 872 * remains intact here.
873 */ 873 */
874# ifdef SUPERUSER_PATH
875 child_set_env(&env, &envsize, "PATH",
876 s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH);
877# else
874 child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); 878 child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
879# endif /* SUPERUSER_PATH */
875# endif /* HAVE_CYGWIN */ 880# endif /* HAVE_CYGWIN */
876#endif /* HAVE_LOGIN_CAP */ 881#endif /* HAVE_LOGIN_CAP */
877 882