summaryrefslogtreecommitdiffstats
path: root/scp.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-06-01 15:01:12 +0200
committerDarren Tucker <dtucker@zip.com.au>2005-06-01 15:01:12 +0200
commitfc4f2dd3470681dae24e9ec95aceb2a2a94c3d7e (patch)
treedb1539f4ee01768031e55e20ca55849f58700532 /scp.c
parent - (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoll.c] (diff)
downloadopenssh-fc4f2dd3470681dae24e9ec95aceb2a2a94c3d7e.tar.xz
openssh-fc4f2dd3470681dae24e9ec95aceb2a2a94c3d7e.zip
- avsm@cvs.openbsd.org 2005/05/26 02:08:05
[scp.c] If copying multiple files to a target file (which normally fails, as it must be a target directory), kill the spawned ssh child before exiting. This stops it trying to authenticate and spewing lots of output. deraadt@ ok
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/scp.c b/scp.c
index 1455c18fd..9dc060e26 100644
--- a/scp.c
+++ b/scp.c
@@ -71,7 +71,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.122 2005/05/24 17:32:43 avsm Exp $");
+RCSID("$OpenBSD: scp.c,v 1.123 2005/05/26 02:08:05 avsm Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -109,11 +109,13 @@ static void
killchild(int signo)
{
if (do_cmd_pid > 1) {
- kill(do_cmd_pid, signo);
+ kill(do_cmd_pid, signo ? signo : SIGTERM);
waitpid(do_cmd_pid, NULL, 0);
}
- _exit(1);
+ if (signo)
+ _exit(1);
+ exit(1);
}
/*
@@ -1072,7 +1074,7 @@ verifydir(char *cp)
errno = ENOTDIR;
}
run_err("%s: %s", cp, strerror(errno));
- exit(1);
+ killchild(0);
}
int