]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: pass SSH_SK_HELPER explicitly past $SUDO to avoid it getting
authordjm@openbsd.org <djm@openbsd.org>
Tue, 21 Jan 2020 08:06:27 +0000 (08:06 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 21 Jan 2020 08:08:37 +0000 (19:08 +1100)
cleared; with dtucker@

OpenBSD-Regress-ID: 03178a0580324bf0dff28f7eac6c3edbc5407f8e

regress/integrity.sh
regress/test-exec.sh
sshd.c

index 5ba6bf6ab0b03b1f04f8db0b0c2f18d6abcc9975..bc030cb74f3566121a446224512c98d31c92c92b 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: integrity.sh,v 1.23 2017/04/30 23:34:55 djm Exp $
+#      $OpenBSD: integrity.sh,v 1.24 2020/01/21 08:06:27 djm Exp $
 #      Placed in the Public Domain.
 
 tid="integrity"
@@ -18,7 +18,7 @@ macs="$macs `${SSH} -Q cipher-auth`"
 #      >> $OBJ/ssh_proxy
 
 # sshd-command for proxy (see test-exec.sh)
-cmd="$SUDO sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy"
+cmd="$SUDO env SSH_SK_HELPER="$SSH_SK_HELPER" sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy"
 
 for m in $macs; do
        trace "test $tid: mac $m"
index 03dab20316333e983876236d91d0ef8e61bb2d00..b448192e12a1c346b5e09d995c81e863d2401e9a 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: test-exec.sh,v 1.69 2019/12/16 02:39:05 djm Exp $
+#      $OpenBSD: test-exec.sh,v 1.70 2020/01/21 08:06:27 djm Exp $
 #      Placed in the Public Domain.
 
 #SUDO=sudo
@@ -598,7 +598,7 @@ fi
 # create a proxy version of the client config
 (
        cat $OBJ/ssh_config
-       echo proxycommand ${SUDO} sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy
+       echo proxycommand ${SUDO} env SSH_SK_HELPER=\"$SSH_SK_HELPER\" sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy
 ) > $OBJ/ssh_proxy
 
 # check proxy config
@@ -608,7 +608,8 @@ start_sshd ()
 {
        # start sshd
        $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken"
-       $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -E$TEST_SSHD_LOGFILE
+       $SUDO env SSH_SK_HELPER="$SSH_SK_HELPER" \
+           ${SSHD} -f $OBJ/sshd_config "$@" -E$TEST_SSHD_LOGFILE
 
        trace "wait for sshd"
        i=0;
diff --git a/sshd.c b/sshd.c
index 0cf13a741744daed887283d9bb952086c63f81df..ecec026bfe3c9293a96f2f6be462eee20c1062e6 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1059,7 +1059,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
 {
        fd_set *fdset;
        int i, j, ret, maxfd;
-       int startups = 0, listening = 0, lameduck = 0;
+       int ostartups = -1, startups = 0, listening = 0, lameduck = 0;
        int startup_p[2] = { -1 , -1 };
        char c = 0;
        struct sockaddr_storage from;
@@ -1084,6 +1084,11 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
         * the daemon is killed with a signal.
         */
        for (;;) {
+               if (ostartups != startups) {
+                       setproctitle("[listener] %d/%d startups",
+                           startups, options.max_startups);
+                       ostartups = startups;
+               }
                if (received_sighup) {
                        if (!lameduck) {
                                debug("Received SIGHUP; waiting for children");