diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | scp.c | 16 |
2 files changed, 19 insertions, 3 deletions
@@ -20,6 +20,10 @@ | |||
20 | - djm@cvs.openbsd.org 2003/06/04 12:18:49 | 20 | - djm@cvs.openbsd.org 2003/06/04 12:18:49 |
21 | [scp.c] | 21 | [scp.c] |
22 | ansify; ok markus@ | 22 | ansify; ok markus@ |
23 | - djm@cvs.openbsd.org 2003/06/04 12:40:39 | ||
24 | [scp.c] | ||
25 | kill ssh process upon receipt of signal, bz #241. | ||
26 | based on patch from esb AT hawaii.edu; ok markus@ | ||
23 | - (djm) Update to fix of bug #584: lock card before return. | 27 | - (djm) Update to fix of bug #584: lock card before return. |
24 | From larsch@trustcenter.de | 28 | From larsch@trustcenter.de |
25 | 29 | ||
@@ -450,4 +454,4 @@ | |||
450 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 454 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
451 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 455 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
452 | 456 | ||
453 | $Id: ChangeLog,v 1.2778 2003/06/04 12:51:08 djm Exp $ | 457 | $Id: ChangeLog,v 1.2779 2003/06/04 12:51:24 djm Exp $ |
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.104 2003/06/04 12:18:49 djm Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.105 2003/06/04 12:40:39 djm Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -107,7 +107,16 @@ int showprogress = 1; | |||
107 | char *ssh_program = _PATH_SSH_PROGRAM; | 107 | char *ssh_program = _PATH_SSH_PROGRAM; |
108 | 108 | ||
109 | /* This is used to store the pid of ssh_program */ | 109 | /* This is used to store the pid of ssh_program */ |
110 | pid_t do_cmd_pid; | 110 | pid_t do_cmd_pid = -1; |
111 | |||
112 | static void | ||
113 | killchild(int signo) | ||
114 | { | ||
115 | if (do_cmd_pid > 1) | ||
116 | kill(do_cmd_pid, signo); | ||
117 | |||
118 | _exit(1); | ||
119 | } | ||
111 | 120 | ||
112 | /* | 121 | /* |
113 | * This function executes the given command as the specified user on the | 122 | * This function executes the given command as the specified user on the |
@@ -170,6 +179,9 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc) | |||
170 | *fdout = pin[1]; | 179 | *fdout = pin[1]; |
171 | close(pout[1]); | 180 | close(pout[1]); |
172 | *fdin = pout[0]; | 181 | *fdin = pout[0]; |
182 | signal(SIGTERM, killchild); | ||
183 | signal(SIGINT, killchild); | ||
184 | signal(SIGHUP, killchild); | ||
173 | return 0; | 185 | return 0; |
174 | } | 186 | } |
175 | 187 | ||