From e4c0c374f4f2b7e0cee9811c21caa2522021a9e4 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 16 Mar 2009 11:55:11 -0400 Subject: Handle FTP servers that both want and don't want PASS after USER (#490350). Before, we were sending PASS only if we got a 230 (success) response to USER and not providing PASS if we got a 331 (gimme a password) response. That's entirely the wrong behavior. --- loader/ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'loader') diff --git a/loader/ftp.c b/loader/ftp.c index 8f8a585f9..15b4f8326 100644 --- a/loader/ftp.c +++ b/loader/ftp.c @@ -330,7 +330,7 @@ int ftpOpen(char *host, int family, char *name, char *password, /* FTP does not require that USER be followed by PASS. Anonymous logins * in particular do not need any password. */ - if (!strncmp(userReply, "230", 3)) { + if (strncmp(userReply, "230", 3) != 0) { if ((rc = ftpCommand(sock, NULL, "PASS", password, NULL))) { close(sock); return rc; -- cgit