if (!result) {
printf("mkdir %s: %s\n", dir, fxp_error());
- sfree(dir);
ret = 0;
} else
printf("mkdir %s: OK\n", dir);
return 0;
}
+int from_backend_untrusted(void *frontend_handle, const char *data, int len)
+{
+ /*
+ * No "untrusted" output should get here (the way the code is
+ * currently, it's all diverted by FLAG_STDERR).
+ */
+ assert(!"Unexpected call to from_backend_untrusted()");
+ return 0; /* not reached */
+}
int sftp_recvdata(char *buf, int len)
{
outptr = (unsigned char *) buf;
printf("%s\n", ver);
printf("Usage: psftp [options] [user@]host\n");
printf("Options:\n");
+ printf(" -V print version information and exit\n");
+ printf(" -pgpfp print PGP key fingerprints and exit\n");
printf(" -b file use specified batchfile\n");
printf(" -bc output batchfile commands\n");
printf(" -be don't stop batchfile processing if errors\n");
printf(" -4 -6 force use of IPv4 or IPv6\n");
printf(" -C enable compression\n");
printf(" -i key private key file for authentication\n");
+ printf(" -noagent disable use of Pageant\n");
+ printf(" -agent enable use of Pageant\n");
printf(" -batch disable all interactive prompts\n");
- printf(" -V print version information\n");
cleanup_exit(1);
}
cfg.username[sizeof(cfg.username) - 1] = '\0';
}
if (!cfg.username[0]) {
- if (!console_get_line("login as: ",
- cfg.username, sizeof(cfg.username), FALSE)) {
+ /* FIXME: leave this to ssh.c? */
+ int ret;
+ prompts_t *p = new_prompts(NULL);
+ p->to_server = TRUE;
+ p->name = dupstr("SSH login name");
+ add_prompt(p, dupstr("login as: "), TRUE, lenof(cfg.username));
+ ret = get_userpass_input(p, NULL, 0);
+ assert(ret >= 0);
+ if (!ret) {
+ free_prompts(p);
fprintf(stderr, "psftp: no username, aborting\n");
cleanup_exit(1);
} else {
- int len = strlen(cfg.username);
- if (cfg.username[len - 1] == '\n')
- cfg.username[len - 1] = '\0';
+ memcpy(cfg.username, p->prompts[0]->result, lenof(cfg.username));
+ free_prompts(p);
}
}
#endif
;
cmdline_tooltype = TOOLTYPE_FILETRANSFER;
- ssh_get_line = &console_get_line;
sk_init();
userhost = user = NULL;
} else if (strcmp(argv[i], "-h") == 0 ||
strcmp(argv[i], "-?") == 0) {
usage();
+ } else if (strcmp(argv[i], "-pgpfp") == 0) {
+ pgp_fingerprints();
+ return 1;
} else if (strcmp(argv[i], "-V") == 0) {
version();
} else if (strcmp(argv[i], "-batch") == 0) {