X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/876eefd49f8857d4e6c87b822fe29d88e9a5230d..55fb297890fbd83482db2d2516a9392befb3eb21:/psftp.h diff --git a/psftp.h b/psftp.h index 0034f84a..2f323c7b 100644 --- a/psftp.h +++ b/psftp.h @@ -33,6 +33,19 @@ void get_file_times(char *filename, unsigned long *mtime, 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, int backend_required); + +/* * The main program in psftp.c. Called from main() in the platform- * specific code, after doing any platform-specific initialisation. */ @@ -137,6 +150,16 @@ 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. */ int create_directory(char *name);