[scp.c]
     start to sync scp closer to rcp; ok markus@
This commit is contained in:
Ben Lindstrom 2001-03-29 00:39:55 +00:00
parent df221391e6
commit bd47226987
2 changed files with 11 additions and 12 deletions

View File

@ -20,6 +20,9 @@
[compat.c compat.h dh.c dh.h ssh2.h sshconnect2.c sshd.c version.h] [compat.c compat.h dh.c dh.h ssh2.h sshconnect2.c sshd.c version.h]
make dh group exchange more flexible, allow min and max group size, make dh group exchange more flexible, allow min and max group size,
okay markus@, deraadt@ okay markus@, deraadt@
- stevesk@cvs.openbsd.org 2001/03/28 19:56:23
[scp.c]
start to sync scp closer to rcp; ok markus@
20010328 20010328
- (djm) Reorder tests and library inclusion for Krb4/AFS to try to - (djm) Reorder tests and library inclusion for Krb4/AFS to try to
@ -4758,4 +4761,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1031 2001/03/29 00:36:16 mouring Exp $ $Id: ChangeLog,v 1.1032 2001/03/29 00:39:55 mouring Exp $

18
scp.c
View File

@ -75,7 +75,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: scp.c,v 1.62 2001/03/21 12:33:33 markus Exp $"); RCSID("$OpenBSD: scp.c,v 1.63 2001/03/28 19:56:23 stevesk Exp $");
#include "xmalloc.h" #include "xmalloc.h"
#include "atomicio.h" #include "atomicio.h"
@ -202,8 +202,6 @@ typedef struct {
char *buf; char *buf;
} BUF; } BUF;
extern int iamremote;
BUF *allocbuf(BUF *, int, int); BUF *allocbuf(BUF *, int, int);
char *colon(char *); char *colon(char *);
void lostconn(int); void lostconn(int);
@ -220,7 +218,6 @@ int pflag, iamremote, iamrecursive, targetshouldbedirectory;
#define CMDNEEDS 64 #define CMDNEEDS 64
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
int main(int, char *[]);
int response(void); int response(void);
void rsource(char *, struct stat *); void rsource(char *, struct stat *);
void sink(int, char *[]); void sink(int, char *[]);
@ -295,7 +292,6 @@ main(argc, argv)
iamremote = 1; iamremote = 1;
tflag = 1; tflag = 1;
break; break;
case '?':
default: default:
usage(); usage();
} }
@ -640,7 +636,7 @@ rsource(name, statp)
closedir(dirp); closedir(dirp);
return; return;
} }
while ((dp = readdir(dirp))) { while ((dp = readdir(dirp)) != NULL) {
if (dp->d_ino == 0) if (dp->d_ino == 0)
continue; continue;
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
@ -769,7 +765,7 @@ sink(argc, argv)
if (*cp++ != ' ') if (*cp++ != ' ')
SCREWUP("mode not delimited"); SCREWUP("mode not delimited");
for (size = 0; *cp >= '0' && *cp <= '9';) for (size = 0; isdigit(*cp);)
size = size * 10 + (*cp++ - '0'); size = size * 10 + (*cp++ - '0');
if (*cp++ != ' ') if (*cp++ != ' ')
SCREWUP("size not delimited"); SCREWUP("size not delimited");
@ -852,7 +848,7 @@ bad: run_err("%s: %s", np, strerror(errno));
continue; continue;
} else if (j <= 0) { } else if (j <= 0) {
run_err("%s", j ? strerror(errno) : run_err("%s", j ? strerror(errno) :
"dropped connection"); "dropped connection");
exit(1); exit(1);
} }
amt -= j; amt -= j;
@ -893,7 +889,7 @@ bad: run_err("%s: %s", np, strerror(errno));
if (chmod(np, omode)) if (chmod(np, omode))
#endif /* HAVE_FCHMOD */ #endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s", run_err("%s: set mode: %s",
np, strerror(errno)); np, strerror(errno));
} else { } else {
if (!exists && omode != mode) if (!exists && omode != mode)
#ifdef HAVE_FCHMOD #ifdef HAVE_FCHMOD
@ -902,7 +898,7 @@ bad: run_err("%s: %s", np, strerror(errno));
if (chmod(np, omode & ~mask)) if (chmod(np, omode & ~mask))
#endif /* HAVE_FCHMOD */ #endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s", run_err("%s: set mode: %s",
np, strerror(errno)); np, strerror(errno));
} }
if (close(ofd) == -1) { if (close(ofd) == -1) {
wrerr = YES; wrerr = YES;
@ -913,7 +909,7 @@ bad: run_err("%s: %s", np, strerror(errno));
setimes = 0; setimes = 0;
if (utimes(np, tv) < 0) { if (utimes(np, tv) < 0) {
run_err("%s: set times: %s", run_err("%s: set times: %s",
np, strerror(errno)); np, strerror(errno));
wrerr = DISPLAYED; wrerr = DISPLAYED;
} }
} }