- (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.
This commit is contained in:
Damien Miller 2001-04-16 18:26:41 +10:00
parent b5cdc66438
commit 21134b5b09
3 changed files with 12 additions and 42 deletions

View File

@ -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 $

39
scp.c
View File

@ -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;

8
sftp.c
View File

@ -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();