]> andersk Git - openssh.git/commitdiff
- (djm) Add --with-superuser-path=xxx configure option to specify what $PATH
authordjm <djm>
Mon, 13 May 2002 00:48:57 +0000 (00:48 +0000)
committerdjm <djm>
Mon, 13 May 2002 00:48:57 +0000 (00:48 +0000)
   the superuser receives.

ChangeLog
acconfig.h
configure.ac
session.c

index dfa05246edd49dc34999b2dceefd81e681ea8dc6..52ac86530366650f679c53f6275c97ffdf0dde82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20020513
+ - (djm) Add --with-superuser-path=xxx configure option to specify what $PATH
+   the superuser receives.
+
 20020511
  - (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch.
    Now only searches system and /usr/local/ssl (OpenSSL's default install path)
index 1a488ff751926ae55ad7fadf595bbe1fa5737a35..5f49965310049cacd1b5bd67cca9fba21b6fb25f 100644 (file)
 /* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */
 #undef WITH_ABBREV_NO_TTY
 
+/* Define if you want a different $PATH for the superuser */
+#undef SUPERUSER_PATH
+
 @BOTTOM@
 
 /* ******************* Shouldn't need to edit below this line ************** */
index c9da138e170e646d72d19d61a7abc367781b151e..6f07b7e365bb907a242b14b84105b484c0102e1d 100644 (file)
@@ -2011,6 +2011,19 @@ if test "$USES_LOGIN_CONF" != "yes" ; then
        AC_SUBST(user_path)
 fi
 
+# Set superuser path separately to user path
+MD5_MSG="no" 
+AC_ARG_WITH(superuser-path,
+       [  --with-superuser-path=  Specify different path for super-user],
+       [
+               if test "x$withval" != "xno" ; then
+                       AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
+                       superuser_path=$withval
+               fi
+       ]
+)
+
+
 # Whether to force IPv4 by default (needed on broken glibc Linux)
 IPV4_HACK_MSG="no" 
 AC_ARG_WITH(ipv4-default,
@@ -2351,6 +2364,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}`
+I=`eval echo ${superuser_path}` ; I=`eval echo ${I}`
 
 echo ""
 echo "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"
 else
 echo "        sshd default user PATH: $H"
 fi
+if test ! -z "$superuser_path" ; then
+echo "      sshd superuser user PATH: $I"
+fi
 echo "                Manpage format: $MANTYPE"
 echo "                   PAM support: ${PAM_MSG}"
 echo "            KerberosIV support: $KRB4_MSG"
index 20e6a889f0bcc7762de383ace5e0be8b970da141..10d803e989c8d747efe44ee54f695f4f8d6310fd 100644 (file)
--- a/session.c
+++ b/session.c
@@ -871,7 +871,12 @@ do_setup_env(Session *s, const char *shell)
                 * needed for loading shared libraries. So the path better
                 * remains intact here.
                 */
+#  ifdef SUPERUSER_PATH
+               child_set_env(&env, &envsize, "PATH", 
+                   s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH);
+#  else 
                child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
+#  endif /* SUPERUSER_PATH */
 # endif /* HAVE_CYGWIN */
 #endif /* HAVE_LOGIN_CAP */
 
This page took 0.05428 seconds and 5 git commands to generate.