~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
draft-ietf-secsh-transport-24 says that only "SSH-" at the start of a line
[sgt/putty]
/
pscp.c
diff --git
a/pscp.c
b/pscp.c
index
d0e045f
..
19e5df4
100644
(file)
--- a/
pscp.c
+++ b/
pscp.c
@@
-213,8
+213,6
@@
int from_backend(void *frontend, int is_stderr, const char *data, int datalen)
if (pendsize < pendlen + len) {
pendsize = pendlen + len + 4096;
pending = sresize(pending, pendsize, unsigned char);
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;
}
memcpy(pending + pendlen, p, len);
pendlen += len;
@@
-751,7
+749,7
@@
static struct fxp_handle *scp_sftp_filehandle;
static struct fxp_xfer *scp_sftp_xfer;
static uint64 scp_sftp_fileoffset;
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 (using_sftp) {
/*
@@
-766,7
+764,7
@@
void scp_source_setup(char *target, int shouldbedir)
if (!fxp_init()) {
tell_user(stderr, "unable to initialise SFTP: %s", fxp_error());
errs++;
if (!fxp_init()) {
tell_user(stderr, "unable to initialise SFTP: %s", fxp_error());
errs++;
- return;
+ return
1
;
}
sftp_register(req = fxp_stat_send(target));
}
sftp_register(req = fxp_stat_send(target));
@@
-789,6
+787,7
@@
void scp_source_setup(char *target, int shouldbedir)
} else {
(void) response();
}
} else {
(void) response();
}
+ return 0;
}
int scp_send_errmsg(char *str)
}
int scp_send_errmsg(char *str)
@@
-1827,7
+1826,7
@@
static void sink(char *targ, char *src)
tell_user(stderr, " when we requested a file "
"called '%s'.", stripsrc);
tell_user(stderr, " If this is a wildcard, "
tell_user(stderr, " when we requested a file "
"called '%s'.", stripsrc);
tell_user(stderr, " If this is a wildcard, "
- "consider upgrading to SSH
2 or using");
+ "consider upgrading to SSH
-
2 or using");
tell_user(stderr, " the '-unsafe' option. Renaming"
" of this file has been disallowed.");
/* Override the name the server provided with our own. */
tell_user(stderr, " the '-unsafe' option. Renaming"
" of this file has been disallowed.");
/* Override the name the server provided with our own. */
@@
-1980,7
+1979,8
@@
static void toremote(int argc, char *argv[])
do_cmd(host, user, cmd);
sfree(cmd);
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];
for (i = 0; i < argc - 1; i++) {
src = argv[i];
@@
-2139,6
+2139,8
@@
static void usage(void)
(" pscp [options] source [source...] [user@]host:target\n");
printf(" pscp [options] -ls [user@]host:filespec\n");
printf("Options:\n");
(" 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(" -p preserve file attributes\n");
printf(" -q quiet, don't show statistics\n");
printf(" -r copy directories recursively\n");
@@
-2153,7
+2155,6
@@
static void usage(void)
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(" -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
printf(" -sftp force use of SFTP protocol\n");
printf(" -scp force use of SCP protocol\n");
#if 0
@@
-2223,6
+2224,9
@@
int psftp_main(int argc, char *argv[])
/* We have our own verbosity in addition to `flags'. */
if (flags & FLAG_VERBOSE)
verbose = 1;
/* 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) {
} else if (strcmp(argv[i], "-r") == 0) {
recursive = 1;
} else if (strcmp(argv[i], "-p") == 0) {