version 1.13.2.3, 2017/04/26 02:52:15 |
version 1.14, 2016/08/02 13:45:12 |
|
|
/* $NetBSD$ */ |
/* $NetBSD$ */ |
/* $OpenBSD: scp.c,v 1.187 2016/09/12 01:22:38 deraadt Exp $ */ |
/* $OpenBSD: scp.c,v 1.186 2016/05/25 23:48:45 schwarze 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). |
|
|
|
|
#include "includes.h" |
#include "includes.h" |
__RCSID("$NetBSD$"); |
__RCSID("$NetBSD$"); |
|
|
#include <sys/param.h> /* roundup MAX */ |
#include <sys/param.h> /* roundup MAX */ |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/poll.h> |
#include <sys/poll.h> |
Line 379 main(int argc, char **argv) |
|
Line 377 main(int argc, char **argv) |
|
setlocale(LC_CTYPE, ""); |
setlocale(LC_CTYPE, ""); |
|
|
/* Copy argv, because we modify it */ |
/* Copy argv, because we modify it */ |
newargv = xcalloc(MAXIMUM(argc + 1, 1), sizeof(*newargv)); |
newargv = xcalloc(MAX(argc + 1, 1), sizeof(*newargv)); |
for (n = 0; n < argc; n++) |
for (n = 0; n < argc; n++) |
newargv[n] = xstrdup(argv[n]); |
newargv[n] = xstrdup(argv[n]); |
argv = newargv; |
argv = newargv; |
Line 1329 allocbuf(BUF *bp, int fd, int blksize) |
|
Line 1327 allocbuf(BUF *bp, int fd, int blksize) |
|
run_err("fstat: %s", strerror(errno)); |
run_err("fstat: %s", strerror(errno)); |
return (0); |
return (0); |
} |
} |
size = ROUNDUP(stb.st_blksize, blksize); |
size = roundup(stb.st_blksize, blksize); |
if (size == 0) |
if (size == 0) |
size = blksize; |
size = blksize; |
if (bp->cnt >= size) |
if (bp->cnt >= size) |