]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cosmetic: Accept ftp://anonymous@ as a synonym for anonymous ftp,
authorserassio <>
Thu, 15 Sep 2005 16:43:13 +0000 (16:43 +0000)
committerserassio <>
Thu, 15 Sep 2005 16:43:13 +0000 (16:43 +0000)
not requiring a password to be entered. This is apparently used by
Symantec Live Update.

Forward port of an old 2.5 patch.

src/ftp.cc

index 25a14954480c9b0b08b58dc7d141f7e6f27acb25..a0f1b31d944181f0bfa98b4606d11b7af8e6e739 100644 (file)
@@ -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