if (pendsize < pendlen + len) {
pendsize = pendlen + len + 4096;
pending = sresize(pending, pendsize, unsigned char);
- if (!pending)
- fatalbox("Out of memory");
}
memcpy(pending + pendlen, p, len);
pendlen += len;
static struct fxp_xfer *scp_sftp_xfer;
static uint64 scp_sftp_fileoffset;
-void scp_source_setup(char *target, int shouldbedir)
+int scp_source_setup(char *target, int shouldbedir)
{
if (using_sftp) {
/*
if (!fxp_init()) {
tell_user(stderr, "unable to initialise SFTP: %s", fxp_error());
errs++;
- return;
+ return 1;
}
sftp_register(req = fxp_stat_send(target));
} else {
(void) response();
}
+ return 0;
}
int scp_send_errmsg(char *str)
do_cmd(host, user, cmd);
sfree(cmd);
- scp_source_setup(targ, targetshouldbedirectory);
+ if (scp_source_setup(targ, targetshouldbedirectory))
+ return;
for (i = 0; i < argc - 1; i++) {
src = argv[i];
(" pscp [options] source [source...] [user@]host:target\n");
printf(" pscp [options] -ls [user@]host:filespec\n");
printf("Options:\n");
+ printf(" -V print version information and exit\n");
+ printf(" -pgpfp print PGP key fingerprints and exit\n");
printf(" -p preserve file attributes\n");
printf(" -q quiet, don't show statistics\n");
printf(" -r copy directories recursively\n");
printf(" -i key private key file for authentication\n");
printf(" -batch disable all interactive prompts\n");
printf(" -unsafe allow server-side wildcards (DANGEROUS)\n");
- printf(" -V print version information\n");
printf(" -sftp force use of SFTP protocol\n");
printf(" -scp force use of SCP protocol\n");
#if 0
/* We have our own verbosity in addition to `flags'. */
if (flags & FLAG_VERBOSE)
verbose = 1;
+ } else if (strcmp(argv[i], "-pgpfp") == 0) {
+ pgp_fingerprints();
+ return 1;
} else if (strcmp(argv[i], "-r") == 0) {
recursive = 1;
} else if (strcmp(argv[i], "-p") == 0) {