summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-01-24 21:57:40 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-01-24 21:57:40 +1100
commitba66df81a38c42c9e7419d1a564be9ae17b62268 (patch)
tree4979ebe30b72cf647f0e733364edda629e7dc900
parent660db78af227f26c6e1ee4ca795400cd7b8ac056 (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--ChangeLog9
-rw-r--r--scp.c6
-rw-r--r--sftp.c6
3 files changed, 16 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d271cf5e..5e77d1e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,13 @@
- djm@cvs.openbsd.org 2005/01/23 10:18:12
[cipher.c]
config option "Ciphers" should be case-sensitive; ok dtucker@
+ - 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@
20050120
- (dtucker) OpenBSD CVS Sync
@@ -2030,4 +2037,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3623 2005/01/24 10:57:11 dtucker Exp $
+$Id: ChangeLog,v 1.3624 2005/01/24 10:57:40 dtucker Exp $
diff --git a/scp.c b/scp.c
index 69b5fc6d..f69fd05f 100644
--- a/scp.c
+++ b/scp.c
@@ -71,7 +71,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.118 2004/09/15 18:46:04 deraadt Exp $");
+RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -108,8 +108,10 @@ pid_t do_cmd_pid = -1;
static void
killchild(int signo)
{
- if (do_cmd_pid > 1)
+ if (do_cmd_pid > 1) {
kill(do_cmd_pid, signo);
+ waitpid(do_cmd_pid, NULL, 0);
+ }
_exit(1);
}
diff --git a/sftp.c b/sftp.c
index 9e29cb02..31c63499 100644
--- a/sftp.c
+++ b/sftp.c
@@ -16,7 +16,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.60 2004/12/10 03:10:42 fgsch Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.61 2005/01/24 10:22:06 dtucker Exp $");
#ifdef USE_LIBEDIT
#include <histedit.h>
@@ -150,8 +150,10 @@ int interactive_loop(int fd_in, int fd_out, char *file1, char *file2);
static void
killchild(int signo)
{
- if (sshpid > 1)
+ if (sshpid > 1) {
kill(sshpid, SIGTERM);
+ waitpid(sshpid, NULL, 0);
+ }
_exit(1);
}