summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
committerColin Watson <cjwatson@debian.org>2020-02-21 11:57:14 +0000
commitf0de78bd4f29fa688c5df116f3f9cd43543a76d0 (patch)
tree856b0dee3f2764c13a32dad5ffe2424fab7fef41 /scp.c
parent4213eec74e74de6310c27a40c3e9759a08a73996 (diff)
parent8aa3455b16fddea4c0144a7c4a1edb10ec67dcc8 (diff)
Import openssh_8.2p1.orig.tar.gz
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/scp.c b/scp.c
index 0348d0673..6901e0c94 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scp.c,v 1.206 2019/09/09 02:31:19 dtucker Exp $ */ 1/* $OpenBSD: scp.c,v 1.207 2020/01/23 07:10:22 dtucker Exp $ */
2/* 2/*
3 * scp - secure remote copy. This is basically patched BSD rcp which 3 * scp - secure remote copy. This is basically patched BSD rcp which
4 * uses ssh to do the data transfer (instead of using rcmd). 4 * uses ssh to do the data transfer (instead of using rcmd).
@@ -94,7 +94,9 @@
94#include <dirent.h> 94#include <dirent.h>
95#include <errno.h> 95#include <errno.h>
96#include <fcntl.h> 96#include <fcntl.h>
97#ifdef HAVE_FNMATCH_H
97#include <fnmatch.h> 98#include <fnmatch.h>
99#endif
98#include <limits.h> 100#include <limits.h>
99#include <locale.h> 101#include <locale.h>
100#include <pwd.h> 102#include <pwd.h>
@@ -213,9 +215,9 @@ do_local_cmd(arglist *a)
213 } 215 }
214 216
215 do_cmd_pid = pid; 217 do_cmd_pid = pid;
216 signal(SIGTERM, killchild); 218 ssh_signal(SIGTERM, killchild);
217 signal(SIGINT, killchild); 219 ssh_signal(SIGINT, killchild);
218 signal(SIGHUP, killchild); 220 ssh_signal(SIGHUP, killchild);
219 221
220 while (waitpid(pid, &status, 0) == -1) 222 while (waitpid(pid, &status, 0) == -1)
221 if (errno != EINTR) 223 if (errno != EINTR)
@@ -266,9 +268,9 @@ do_cmd(char *host, char *remuser, int port, char *cmd, int *fdin, int *fdout)
266 close(reserved[0]); 268 close(reserved[0]);
267 close(reserved[1]); 269 close(reserved[1]);
268 270
269 signal(SIGTSTP, suspchild); 271 ssh_signal(SIGTSTP, suspchild);
270 signal(SIGTTIN, suspchild); 272 ssh_signal(SIGTTIN, suspchild);
271 signal(SIGTTOU, suspchild); 273 ssh_signal(SIGTTOU, suspchild);
272 274
273 /* Fork a child to execute the command on the remote host using ssh. */ 275 /* Fork a child to execute the command on the remote host using ssh. */
274 do_cmd_pid = fork(); 276 do_cmd_pid = fork();
@@ -305,9 +307,9 @@ do_cmd(char *host, char *remuser, int port, char *cmd, int *fdin, int *fdout)
305 *fdout = pin[1]; 307 *fdout = pin[1];
306 close(pout[1]); 308 close(pout[1]);
307 *fdin = pout[0]; 309 *fdin = pout[0];
308 signal(SIGTERM, killchild); 310 ssh_signal(SIGTERM, killchild);
309 signal(SIGINT, killchild); 311 ssh_signal(SIGINT, killchild);
310 signal(SIGHUP, killchild); 312 ssh_signal(SIGHUP, killchild);
311 return 0; 313 return 0;
312} 314}
313 315
@@ -559,7 +561,7 @@ main(int argc, char **argv)
559 iamrecursive ? " -r" : "", pflag ? " -p" : "", 561 iamrecursive ? " -r" : "", pflag ? " -p" : "",
560 targetshouldbedirectory ? " -d" : ""); 562 targetshouldbedirectory ? " -d" : "");
561 563
562 (void) signal(SIGPIPE, lostconn); 564 (void) ssh_signal(SIGPIPE, lostconn);
563 565
564 if (colon(argv[argc - 1])) /* Dest is remote host. */ 566 if (colon(argv[argc - 1])) /* Dest is remote host. */
565 toremote(argc, argv); 567 toremote(argc, argv);