25044066 sshd error: session_by_pid: unknown pid when root ssh session exits
authorTomas Kuthan <tomas.kuthan@oracle.com>
Wed, 11 Jan 2017 12:12:15 -0800
changeset 7562 2adf9e2cdc69
parent 7561 64cbdac1f406
child 7563 328fee062f83
25044066 sshd error: session_by_pid: unknown pid when root ssh session exits
components/openssh/patches/047-login_grace_time_watchdog.patch
--- a/components/openssh/patches/047-login_grace_time_watchdog.patch	Wed Jan 11 12:12:15 2017 -0800
+++ b/components/openssh/patches/047-login_grace_time_watchdog.patch	Wed Jan 11 12:12:15 2017 -0800
@@ -36,7 +36,7 @@
  
  #ifdef WITH_SSH1
  static void do_ssh1_kex(void);
[email protected]@ -369,12 +376,98 @@ grace_alarm_handler(int sig)
[email protected]@ -369,12 +376,102 @@ grace_alarm_handler(int sig)
  		signal(SIGTERM, SIG_IGN);
  		kill(0, SIGTERM);
  	}
@@ -128,6 +128,10 @@
 +	}
 +
 +	kill(grace_watchdog_pid, SIGTERM);
++	while (waitpid(grace_watchdog_pid, NULL, 0) < 0) {
++		if (errno == EINTR)
++			continue;
++	}
 +	grace_watchdog_pid = -1;
 +}
 +
@@ -135,7 +139,7 @@
  /*
   * Signal handler for the key regeneration alarm.  Note that this
   * alarm only occurs in the daemon waiting for connections, and it does not
[email protected]@ -723,6 +816,7 @@ privsep_preauth(Authctxt *authctxt)
[email protected]@ -723,6 +820,7 @@ privsep_preauth(Authctxt *authctxt)
  		/* child */
  		close(pmonitor->m_sendfd);
  		close(pmonitor->m_log_recvfd);
@@ -143,7 +147,7 @@
  
  		/* Arrange for logging to be sent to the monitor */
  		set_log_handler(mm_log_handler, pmonitor);
[email protected]@ -2235,8 +2329,10 @@ main(int ac, char **av)
[email protected]@ -2235,8 +2333,10 @@ main(int ac, char **av)
  	 * are about to discover the bug.
  	 */
  	signal(SIGALRM, grace_alarm_handler);
@@ -155,7 +159,7 @@
  
  	sshd_exchange_identification(ssh, sock_in, sock_out);
  
[email protected]@ -2302,6 +2398,7 @@ main(int ac, char **av)
[email protected]@ -2302,6 +2402,7 @@ main(int ac, char **av)
  	 */
  	alarm(0);
  	signal(SIGALRM, SIG_DFL);