=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/monitor.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- src/usr.bin/ssh/monitor.c 2012/12/02 20:34:10 1.119 +++ src/usr.bin/ssh/monitor.c 2012/12/11 22:16:21 1.120 @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.119 2012/12/02 20:34:10 djm Exp $ */ +/* $OpenBSD: monitor.c,v 1.120 2012/12/11 22:16:21 markus Exp $ */ /* * Copyright 2002 Niels Provos * Copyright 2002 Markus Friedl @@ -346,10 +346,6 @@ #endif } - /* Drain any buffered messages from the child */ - while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0) - ; - if (!authctxt->valid) fatal("%s: authenticated invalid user", __func__); if (strcmp(auth_method, "unknown") == 0) @@ -359,6 +355,10 @@ __func__, authctxt->user); mm_get_keystate(pmonitor); + + /* Drain any buffered messages from the child */ + while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0) + ; close(pmonitor->m_sendfd); close(pmonitor->m_log_recvfd);