]> andersk Git - openssh.git/blobdiff - scp.c
- (tim) [configure.ac] Move CHECK_HEADERS test before platform specific
[openssh.git] / scp.c
diff --git a/scp.c b/scp.c
index cfe2165e69f4e29d1b1615d26a673376287bc207..56a3e79ffa2b5ae1a12dfac1e5486af9866efdcb 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.143 2006/07/06 16:03:53 stevesk Exp $ */
+/* $OpenBSD: scp.c,v 1.155 2006/08/03 03:34:42 deraadt Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
  * uses ssh to do the data transfer (instead of using rcmd).
 #include "includes.h"
 
 #include <sys/types.h>
+#include <sys/param.h>
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
 #include <sys/wait.h>
+#include <sys/uio.h>
 
 #include <ctype.h>
 #include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <pwd.h>
 #include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
 
 #include "xmalloc.h"
 #include "atomicio.h"
@@ -271,15 +284,21 @@ void usage(void);
 int
 main(int argc, char **argv)
 {
-       int ch, fflag, tflag, status;
+       int ch, fflag, tflag, status, n;
        double speed;
-       char *targ, *endp;
+       char *targ, *endp, **newargv;
        extern char *optarg;
        extern int optind;
 
        /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
        sanitise_stdfd();
 
+       /* Copy argv, because we modify it */
+       newargv = xcalloc(MAX(argc + 1, 1), sizeof(*newargv));
+       for (n = 0; n < argc; n++)
+               newargv[n] = xstrdup(argv[n]);
+       argv = newargv;
+
        __progname = ssh_get_progname(argv[0]);
 
        memset(&args, '\0', sizeof(args));
This page took 0.032644 seconds and 4 git commands to generate.