summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--monitor.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 85f251ce5..b96329ef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
120121212
2 - (djm) OpenBSD CVS Sync
3 - markus@cvs.openbsd.org 2012/12/11 22:16:21
4 [monitor.c]
5 drain the log messages after receiving the keystate from the unpriv
6 child. otherwise it might block while sending. ok djm@
7
120121207 820121207
2 - (dtucker) OpenBSD CVS Sync 9 - (dtucker) OpenBSD CVS Sync
3 - dtucker@cvs.openbsd.org 2012/12/06 06:06:54 10 - dtucker@cvs.openbsd.org 2012/12/06 06:06:54
diff --git a/monitor.c b/monitor.c
index 1cfc48757..8006b833c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.119 2012/12/02 20:34:10 djm Exp $ */ 1/* $OpenBSD: monitor.c,v 1.120 2012/12/11 22:16:21 markus Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -438,10 +438,6 @@ monitor_child_preauth(Authctxt *_authctxt, struct monitor *pmonitor)
438#endif 438#endif
439 } 439 }
440 440
441 /* Drain any buffered messages from the child */
442 while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0)
443 ;
444
445 if (!authctxt->valid) 441 if (!authctxt->valid)
446 fatal("%s: authenticated invalid user", __func__); 442 fatal("%s: authenticated invalid user", __func__);
447 if (strcmp(auth_method, "unknown") == 0) 443 if (strcmp(auth_method, "unknown") == 0)
@@ -452,6 +448,10 @@ monitor_child_preauth(Authctxt *_authctxt, struct monitor *pmonitor)
452 448
453 mm_get_keystate(pmonitor); 449 mm_get_keystate(pmonitor);
454 450
451 /* Drain any buffered messages from the child */
452 while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0)
453 ;
454
455 close(pmonitor->m_sendfd); 455 close(pmonitor->m_sendfd);
456 close(pmonitor->m_log_recvfd); 456 close(pmonitor->m_log_recvfd);
457 pmonitor->m_sendfd = pmonitor->m_log_recvfd = -1; 457 pmonitor->m_sendfd = pmonitor->m_log_recvfd = -1;