- (djm) OpenBSD CVS Sync

- deraadt@cvs.openbsd.org 2006/04/01 05:42:20
     [scp.c]
     minimal lint cleanup (unused crud, and some size_t); ok djm
This commit is contained in:
Damien Miller 2006-04-23 12:04:27 +10:00
parent 73b42d2bb0
commit 07aa132a5e
2 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,9 @@
20060423
- (djm) OpenBSD CVS Sync
- deraadt@cvs.openbsd.org 2006/04/01 05:42:20
[scp.c]
minimal lint cleanup (unused crud, and some size_t); ok djm
20060421 20060421
- (djm) [Makefile.in configure.ac session.c sshpty.c] - (djm) [Makefile.in configure.ac session.c sshpty.c]
[contrib/redhat/sshd.init openbsd-compat/Makefile.in] [contrib/redhat/sshd.init openbsd-compat/Makefile.in]
@ -4508,4 +4514,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.4302 2006/04/22 11:26:08 djm Exp $ $Id: ChangeLog,v 1.4303 2006/04/23 02:04:27 djm Exp $

20
scp.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: scp.c,v 1.139 2006/03/25 13:17:02 djm Exp $ */ /* $OpenBSD: scp.c,v 1.140 2006/04/01 05:42:20 deraadt Exp $ */
/* /*
* scp - secure remote copy. This is basically patched BSD rcp which * scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd). * uses ssh to do the data transfer (instead of using rcmd).
@ -92,6 +92,8 @@
extern char *__progname; extern char *__progname;
int do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout);
void bwlimit(int); void bwlimit(int);
/* Struct for addargs */ /* Struct for addargs */
@ -177,7 +179,7 @@ do_local_cmd(arglist *a)
*/ */
int int
do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc) do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout)
{ {
int pin[2], pout[2], reserved[2]; int pin[2], pout[2], reserved[2];
@ -244,7 +246,6 @@ typedef struct {
BUF *allocbuf(BUF *, int, int); BUF *allocbuf(BUF *, int, int);
void lostconn(int); void lostconn(int);
void nospace(void);
int okname(char *); int okname(char *);
void run_err(const char *,...); void run_err(const char *,...);
void verifydir(char *); void verifydir(char *);
@ -419,9 +420,10 @@ main(int argc, char **argv)
void void
toremote(char *targ, int argc, char **argv) toremote(char *targ, int argc, char **argv)
{ {
int i, len;
char *bp, *host, *src, *suser, *thost, *tuser, *arg; char *bp, *host, *src, *suser, *thost, *tuser, *arg;
arglist alist; arglist alist;
size_t len;
int i;
memset(&alist, '\0', sizeof(alist)); memset(&alist, '\0', sizeof(alist));
alist.list = NULL; alist.list = NULL;
@ -491,7 +493,7 @@ toremote(char *targ, int argc, char **argv)
(void) snprintf(bp, len, "%s -t %s", cmd, targ); (void) snprintf(bp, len, "%s -t %s", cmd, targ);
host = cleanhostname(thost); host = cleanhostname(thost);
if (do_cmd(host, tuser, bp, &remin, if (do_cmd(host, tuser, bp, &remin,
&remout, argc) < 0) &remout) < 0)
exit(1); exit(1);
if (response() < 0) if (response() < 0)
exit(1); exit(1);
@ -505,9 +507,10 @@ toremote(char *targ, int argc, char **argv)
void void
tolocal(int argc, char **argv) tolocal(int argc, char **argv)
{ {
int i, len;
char *bp, *host, *src, *suser; char *bp, *host, *src, *suser;
arglist alist; arglist alist;
size_t len;
int i;
memset(&alist, '\0', sizeof(alist)); memset(&alist, '\0', sizeof(alist));
alist.list = NULL; alist.list = NULL;
@ -542,7 +545,7 @@ tolocal(int argc, char **argv)
len = strlen(src) + CMDNEEDS + 20; len = strlen(src) + CMDNEEDS + 20;
bp = xmalloc(len); bp = xmalloc(len);
(void) snprintf(bp, len, "%s -f %s", cmd, src); (void) snprintf(bp, len, "%s -f %s", cmd, src);
if (do_cmd(host, suser, bp, &remin, &remout, argc) < 0) { if (do_cmd(host, suser, bp, &remin, &remout) < 0) {
(void) xfree(bp); (void) xfree(bp);
++errs; ++errs;
continue; continue;
@ -787,7 +790,8 @@ sink(int argc, char **argv)
BUF *bp; BUF *bp;
off_t i; off_t i;
size_t j, count; size_t j, count;
int amt, exists, first, mask, mode, ofd, omode; int amt, exists, first, ofd;
mode_t mode, omode, mask;
off_t size, statbytes; off_t size, statbytes;
int setimes, targisdir, wrerrno = 0; int setimes, targisdir, wrerrno = 0;
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];