summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-04-16 18:26:41 +1000
committerDamien Miller <djm@mindrot.org>2001-04-16 18:26:41 +1000
commit21134b5b09ad480a2283f1b63c0c1e3a68515274 (patch)
tree30267755775b3bebba8b8fe0bc627f1e95924c7b
parentb5cdc6643848d170156770821ce946dae0d3f844 (diff)
- (djm) OpenBSD CVS Sync
- mouring@cvs.openbsd.org 2001/04/16 02:31:44 [scp.c sftp.c] IPv6 support for sftp (which I bungled in my last patch) which is borrowed from scp.c. Thanks to Markus@ for pointing it out.
-rw-r--r--ChangeLog7
-rw-r--r--scp.c39
-rw-r--r--sftp.c8
3 files changed, 12 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index 49f76a5e..42860641 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,11 @@
- (djm) Convert mandoc manpages to man automatically. Patch from Mark D.
Roth <roth+openssh@feep.net>
- (bal) CVS ID fix up and slight manpage fix from OpenBSD tree.
+ - (djm) OpenBSD CVS Sync
+ - mouring@cvs.openbsd.org 2001/04/16 02:31:44
+ [scp.c sftp.c]
+ IPv6 support for sftp (which I bungled in my last patch) which is
+ borrowed from scp.c. Thanks to Markus@ for pointing it out.
20010415
- OpenBSD CVS Sync
@@ -5107,4 +5112,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1124 2001/04/16 02:13:26 mouring Exp $
+$Id: ChangeLog,v 1.1125 2001/04/16 08:26:41 djm Exp $
diff --git a/scp.c b/scp.c
index ef8ed9f2..0c4400f6 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.66 2001/04/14 17:04:42 stevesk Exp $");
+RCSID("$OpenBSD: scp.c,v 1.67 2001/04/16 02:31:43 mouring Exp $");
#include "xmalloc.h"
#include "atomicio.h"
@@ -203,7 +203,6 @@ typedef struct {
} BUF;
BUF *allocbuf(BUF *, int, int);
-char *colon(char *);
void lostconn(int);
void nospace(void);
int okname(char *);
@@ -223,7 +222,6 @@ void rsource(char *, struct stat *);
void sink(int, char *[]);
void source(int, char *[]);
void tolocal(int, char *[]);
-char *cleanhostname(char *);
void toremote(char *, int, char *[]);
void usage(void);
@@ -345,17 +343,6 @@ main(argc, argv)
exit(errs != 0);
}
-char *
-cleanhostname(host)
- char *host;
-{
- if (*host == '[' && host[strlen(host) - 1] == ']') {
- host[strlen(host) - 1] = '\0';
- return (host + 1);
- } else
- return host;
-}
-
void
toremote(targ, argc, argv)
char *targ, *argv[];
@@ -1000,30 +987,6 @@ run_err(const char *fmt,...)
}
}
-char *
-colon(cp)
- char *cp;
-{
- int flag = 0;
-
- if (*cp == ':') /* Leading colon is part of file name. */
- return (0);
- if (*cp == '[')
- flag = 1;
-
- for (; *cp; ++cp) {
- if (*cp == '@' && *(cp+1) == '[')
- flag = 1;
- if (*cp == ']' && *(cp+1) == ':' && flag)
- return (cp+1);
- if (*cp == ':' && !flag)
- return (cp);
- if (*cp == '/')
- return (0);
- }
- return (0);
-}
-
void
verifydir(cp)
char *cp;
diff --git a/sftp.c b/sftp.c
index 911a04f2..8c887fbc 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,10 +24,9 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.14 2001/04/12 23:17:54 mouring Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.15 2001/04/16 02:31:44 mouring Exp $");
/* XXX: commandline mode */
-/* XXX: copy between two remote hosts (commandline) */
/* XXX: short-form remote directory listings (like 'ls -C') */
#include "buffer.h"
@@ -46,6 +45,8 @@ extern char *__progname;
char *__progname;
#endif
+#include "scp-common.h"
+
int use_ssh1 = 0;
char *ssh_program = _PATH_SSH_PROGRAM;
char *sftp_server = NULL;
@@ -209,7 +210,7 @@ main(int argc, char **argv)
userhost = xstrdup(argv[optind]);
file2 = argv[optind+1];
- if ((cp = strchr(userhost, ':')) != NULL) {
+ if ((cp = colon(userhost)) != NULL) {
*cp++ = '\0';
file1 = cp;
}
@@ -226,6 +227,7 @@ main(int argc, char **argv)
make_ssh_args(userhost);
}
+ host = cleanhostname(host);
if (!*host) {
fprintf(stderr, "Missing hostname\n");
usage();