summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ssh.c23
2 files changed, 19 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index b25d87490..41c47d2ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,11 @@
18 depends on the platform supporting sane O_NONBLOCK semantics for open 18 depends on the platform supporting sane O_NONBLOCK semantics for open
19 on FIFOs (apparently POSIX does not mandate this), which OpenBSD does. 19 on FIFOs (apparently POSIX does not mandate this), which OpenBSD does.
20 bz #856; report by cjwatson AT debian.org; ok markus@ 20 bz #856; report by cjwatson AT debian.org; ok markus@
21 - djm@cvs.openbsd.org 2007/06/12 11:11:08
22 [ssh.c]
23 fix slave exit value when a control master goes away without passing the
24 full exit status by ensuring that the slave reads a full int. bz#1261
25 reported by frekko AT gmail.com; ok markus@ dtucker@
21 26
2220070611 2720070611
23 - (djm) Bugzilla #1306: silence spurious error messages from hang-on-exit 28 - (djm) Bugzilla #1306: silence spurious error messages from hang-on-exit
@@ -3032,4 +3037,4 @@
3032 OpenServer 6 and add osr5bigcrypt support so when someone migrates 3037 OpenServer 6 and add osr5bigcrypt support so when someone migrates
3033 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 3038 passwords between UnixWare and OpenServer they will still work. OK dtucker@
3034 3039
3035$Id: ChangeLog,v 1.4692 2007/06/12 13:41:06 dtucker Exp $ 3040$Id: ChangeLog,v 1.4693 2007/06/12 13:41:33 dtucker Exp $
diff --git a/ssh.c b/ssh.c
index cfaa1ff22..74c9a091b 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.295 2007/01/03 03:01:40 stevesk Exp $ */ 1/* $OpenBSD: ssh.c,v 1.296 2007/06/12 11:11:08 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1458,25 +1458,28 @@ control_client(const char *path)
1458 1458
1459 /* Stick around until the controlee closes the client_fd */ 1459 /* Stick around until the controlee closes the client_fd */
1460 exitval = 0; 1460 exitval = 0;
1461 for (;!control_client_terminate;) { 1461 for (i = 0; !control_client_terminate && i < (int)sizeof(exitval);) {
1462 r = read(sock, &exitval, sizeof(exitval)); 1462 r = read(sock, (char *)&exitval + i, sizeof(exitval) - i);
1463 if (r == 0) { 1463 if (r == 0) {
1464 debug2("Received EOF from master"); 1464 debug2("Received EOF from master");
1465 break; 1465 break;
1466 } 1466 }
1467 if (r > 0)
1468 debug2("Received exit status from master %d", exitval);
1469 if (r == -1 && errno != EINTR) 1467 if (r == -1 && errno != EINTR)
1470 fatal("%s: read %s", __func__, strerror(errno)); 1468 fatal("%s: read %s", __func__, strerror(errno));
1469 i += r;
1471 } 1470 }
1472
1473 if (control_client_terminate)
1474 debug2("Exiting on signal %d", control_client_terminate);
1475
1476 close(sock); 1471 close(sock);
1477
1478 leave_raw_mode(); 1472 leave_raw_mode();
1479 1473
1474 if (control_client_terminate) {
1475 debug2("Exiting on signal %d", control_client_terminate);
1476 exitval = 255;
1477 } else if (i < (int)sizeof(exitval)) {
1478 debug2("Control master terminated unexpectedly");
1479 exitval = 255;
1480 } else
1481 debug2("Received exit status from master %d", exitval);
1482
1480 if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET) 1483 if (tty_flag && options.log_level != SYSLOG_LEVEL_QUIET)
1481 fprintf(stderr, "Connection to master closed.\r\n"); 1484 fprintf(stderr, "Connection to master closed.\r\n");
1482 1485