diff options
author | Darren Tucker <dtucker@zip.com.au> | 2005-01-24 21:57:40 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2005-01-24 21:57:40 +1100 |
commit | ba66df81a38c42c9e7419d1a564be9ae17b62268 (patch) | |
tree | 4979ebe30b72cf647f0e733364edda629e7dc900 | |
parent | 660db78af227f26c6e1ee4ca795400cd7b8ac056 (diff) |
- dtucker@cvs.openbsd.org 2005/01/24 10:22:06
[scp.c sftp.c]
Have scp and sftp wait for the spawned ssh to exit before they exit
themselves. This prevents ssh from being unable to restore terminal
modes (not normally a problem on OpenBSD but common with -Portable
on POSIX platforms). From peak at argo.troja.mff.cuni.cz (bz#950);
ok djm@ markus@
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | scp.c | 6 | ||||
-rw-r--r-- | sftp.c | 6 |
3 files changed, 16 insertions, 5 deletions
@@ -12,6 +12,13 @@ | |||
12 | - djm@cvs.openbsd.org 2005/01/23 10:18:12 | 12 | - djm@cvs.openbsd.org 2005/01/23 10:18:12 |
13 | [cipher.c] | 13 | [cipher.c] |
14 | config option "Ciphers" should be case-sensitive; ok dtucker@ | 14 | config option "Ciphers" should be case-sensitive; ok dtucker@ |
15 | - dtucker@cvs.openbsd.org 2005/01/24 10:22:06 | ||
16 | [scp.c sftp.c] | ||
17 | Have scp and sftp wait for the spawned ssh to exit before they exit | ||
18 | themselves. This prevents ssh from being unable to restore terminal | ||
19 | modes (not normally a problem on OpenBSD but common with -Portable | ||
20 | on POSIX platforms). From peak at argo.troja.mff.cuni.cz (bz#950); | ||
21 | ok djm@ markus@ | ||
15 | 22 | ||
16 | 20050120 | 23 | 20050120 |
17 | - (dtucker) OpenBSD CVS Sync | 24 | - (dtucker) OpenBSD CVS Sync |
@@ -2030,4 +2037,4 @@ | |||
2030 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2037 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2031 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2038 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2032 | 2039 | ||
2033 | $Id: ChangeLog,v 1.3623 2005/01/24 10:57:11 dtucker Exp $ | 2040 | $Id: ChangeLog,v 1.3624 2005/01/24 10:57:40 dtucker Exp $ |
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.118 2004/09/15 18:46:04 deraadt Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -108,8 +108,10 @@ pid_t do_cmd_pid = -1; | |||
108 | static void | 108 | static void |
109 | killchild(int signo) | 109 | killchild(int signo) |
110 | { | 110 | { |
111 | if (do_cmd_pid > 1) | 111 | if (do_cmd_pid > 1) { |
112 | kill(do_cmd_pid, signo); | 112 | kill(do_cmd_pid, signo); |
113 | waitpid(do_cmd_pid, NULL, 0); | ||
114 | } | ||
113 | 115 | ||
114 | _exit(1); | 116 | _exit(1); |
115 | } | 117 | } |
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | 18 | ||
19 | RCSID("$OpenBSD: sftp.c,v 1.60 2004/12/10 03:10:42 fgsch Exp $"); | 19 | RCSID("$OpenBSD: sftp.c,v 1.61 2005/01/24 10:22:06 dtucker Exp $"); |
20 | 20 | ||
21 | #ifdef USE_LIBEDIT | 21 | #ifdef USE_LIBEDIT |
22 | #include <histedit.h> | 22 | #include <histedit.h> |
@@ -150,8 +150,10 @@ int interactive_loop(int fd_in, int fd_out, char *file1, char *file2); | |||
150 | static void | 150 | static void |
151 | killchild(int signo) | 151 | killchild(int signo) |
152 | { | 152 | { |
153 | if (sshpid > 1) | 153 | if (sshpid > 1) { |
154 | kill(sshpid, SIGTERM); | 154 | kill(sshpid, SIGTERM); |
155 | waitpid(sshpid, NULL, 0); | ||
156 | } | ||
155 | 157 | ||
156 | _exit(1); | 158 | _exit(1); |
157 | } | 159 | } |