From: serassio <> Date: Thu, 15 Sep 2005 16:43:13 +0000 (+0000) Subject: Cosmetic: Accept ftp://anonymous@ as a synonym for anonymous ftp, X-Git-Tag: SQUID_3_0_PRE4~619 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=834f0ffa03a0cbff3d77d4c5e2ff6ea0d07533dd;p=thirdparty%2Fsquid.git Cosmetic: Accept ftp://anonymous@ as a synonym for anonymous ftp, not requiring a password to be entered. This is apparently used by Symantec Live Update. Forward port of an old 2.5 patch. --- diff --git a/src/ftp.cc b/src/ftp.cc index 25a1495448..a0f1b31d94 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.368 2005/09/15 10:25:07 serassio Exp $ + * $Id: ftp.cc,v 1.369 2005/09/15 10:43:13 serassio Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -439,12 +439,11 @@ ftpLoginParser(const char *login, FtpStateData * ftpState, int escaped) if (escaped) rfc1738_unescape(ftpState->user); - if (ftpState->user[0] || ftpState->password[0]) - return; - - xstrncpy(ftpState->user, "anonymous", MAX_URL); + if (!ftpState->user[0]) + xstrncpy(ftpState->user, "anonymous", MAX_URL); - xstrncpy(ftpState->password, Config.Ftp.anon_user, MAX_URL); + if (strcmp(ftpState->user, "anonymous") == 0 && !ftpState->password[0]) + xstrncpy(ftpState->password, Config.Ftp.anon_user, MAX_URL); } static void