version 1.23, 2002/02/04 21:53:12 |
version 1.24, 2002/02/05 00:00:46 |
|
|
#include "sftp-int.h" |
#include "sftp-int.h" |
|
|
FILE* infile; |
FILE* infile; |
|
size_t copy_buffer_len = 32768; |
|
|
static void |
static void |
connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid) |
connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid) |
|
|
{ |
{ |
fprintf(stderr, |
fprintf(stderr, |
"usage: sftp [-1Cv] [-b batchfile] [-F config] [-o option] [-s subsystem|path]\n" |
"usage: sftp [-1Cv] [-b batchfile] [-F config] [-o option] [-s subsystem|path]\n" |
" [-S program] [user@]host[:file [file]]\n"); |
" [-P direct server path] [-S program] \n" |
|
" [-B buffer_size] [user@]host[:file [file]]\n"); |
exit(1); |
exit(1); |
} |
} |
|
|
|
|
ll = SYSLOG_LEVEL_INFO; |
ll = SYSLOG_LEVEL_INFO; |
infile = stdin; /* Read from STDIN unless changed by -b */ |
infile = stdin; /* Read from STDIN unless changed by -b */ |
|
|
while ((ch = getopt(argc, argv, "1hvCo:s:S:b:F:P:")) != -1) { |
while ((ch = getopt(argc, argv, "1hvCo:s:S:b:B:F:P:")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'C': |
case 'C': |
addargs(&args, "-C"); |
addargs(&args, "-C"); |
|
|
break; |
break; |
case 'P': |
case 'P': |
sftp_direct = optarg; |
sftp_direct = optarg; |
|
break; |
|
case 'B': |
|
copy_buffer_len = strtol(optarg, &cp, 10); |
|
if (copy_buffer_len == 0 || *cp != '\0') |
|
fatal("Invalid buffer size \"%s\"", optarg); |
break; |
break; |
case 'h': |
case 'h': |
default: |
default: |