X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=psftp.h;h=2f323c7b6c88afd9c412cf83cb14783f72a33981;hb=49d2cf19accb059b3b68d1fc2b78e606a578c3e8;hp=6ce24e8fe69ae1261492c98f4fcffafb3c9b6692;hpb=7ecf13564a8d716000ce78146d1aaf4422432a4f;p=PuTTY.git diff --git a/psftp.h b/psftp.h index 6ce24e8f..2f323c7b 100644 --- a/psftp.h +++ b/psftp.h @@ -35,8 +35,15 @@ int ssh_sftp_loop_iteration(void); /* * Read a command line for PSFTP from standard input. Caller must * free. + * + * If `backend_required' is TRUE, should also listen for activity + * at the backend (rekeys, clientalives, unexpected closures etc) + * and respond as necessary, and if the backend closes it should + * treat this as a failure condition. If `backend_required' is + * FALSE, a back end is not (intentionally) active at all (e.g. + * psftp before an `open' command). */ -char *ssh_sftp_get_cmdline(char *prompt); +char *ssh_sftp_get_cmdline(char *prompt, int backend_required); /* * The main program in psftp.c. Called from main() in the platform- @@ -142,6 +149,16 @@ WildcardMatcher *begin_wildcard_matching(char *name); char *wildcard_get_filename(WildcardMatcher *dir); void finish_wildcard_matching(WildcardMatcher *dir); +/* + * Vet a filename returned from the remote host, to ensure it isn't + * in some way malicious. The idea is that this function is applied + * to filenames returned from FXP_READDIR, which means we can panic + * if we see _anything_ resembling a directory separator. + * + * Returns TRUE if the filename is kosher, FALSE if dangerous. + */ +int vet_filename(char *name); + /* * Create a directory. Returns 0 on error, !=0 on success. */