Sun Jul 12 09:45:02 2009 UTC ()
Add fix for Squid bug 2707 to make anonymous FTP work again.


(tron)
diff -r1.9 -r1.10 pkgsrc/www/squid31/Makefile
diff -r1.5 -r1.6 pkgsrc/www/squid31/distinfo
diff -r0 -r1.3 pkgsrc/www/squid31/patches/patch-aa

cvs diff -r1.9 -r1.10 pkgsrc/www/squid31/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/www/squid31/Attic/Makefile 2009/07/08 15:02:01 1.9
+++ pkgsrc/www/squid31/Attic/Makefile 2009/07/12 09:45:02 1.10
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.9 2009/07/08 15:02:01 tron Exp $ 1# $NetBSD: Makefile,v 1.10 2009/07/12 09:45:02 tron Exp $
2 2
3DISTNAME= squid-3.1.0.9 3DISTNAME= squid-3.1.0.9
 4PKGREVISION= 1
4PKGNAME= ${DISTNAME} # Necessary for "pkgsrc/www/squid/options.mk" 5PKGNAME= ${DISTNAME} # Necessary for "pkgsrc/www/squid/options.mk"
5CATEGORIES= www 6CATEGORIES= www
6MASTER_SITES= ${SQUID_MASTER_SITES} \ 7MASTER_SITES= ${SQUID_MASTER_SITES} \
7 http://www.squid-cache.org/Versions/v3/3.1/ 8 http://www.squid-cache.org/Versions/v3/3.1/
8EXTRACT_SUFX= .tar.bz2 9EXTRACT_SUFX= .tar.bz2
9 10
10MAINTAINER= tron@NetBSD.org 11MAINTAINER= tron@NetBSD.org
11HOMEPAGE= http://www.squid-cache.org/ 12HOMEPAGE= http://www.squid-cache.org/
12COMMENT= Post-Harvest_cached WWW proxy cache and accelerator 13COMMENT= Post-Harvest_cached WWW proxy cache and accelerator
13LICENSE= gnu-gpl-v2 14LICENSE= gnu-gpl-v2
14 15
15USE_LANGUAGES= c c++ 16USE_LANGUAGES= c c++
16USE_TOOLS+= perl gmake 17USE_TOOLS+= perl gmake

cvs diff -r1.5 -r1.6 pkgsrc/www/squid31/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/www/squid31/Attic/distinfo 2009/07/07 18:25:13 1.5
+++ pkgsrc/www/squid31/Attic/distinfo 2009/07/12 09:45:02 1.6
@@ -1,11 +1,12 @@ @@ -1,11 +1,12 @@
1$NetBSD: distinfo,v 1.5 2009/07/07 18:25:13 tron Exp $ 1$NetBSD: distinfo,v 1.6 2009/07/12 09:45:02 tron Exp $
2 2
3SHA1 (squid-3.1.0.9.tar.bz2) = 221cc189c1c69e61819540ceb798ded728c2579a 3SHA1 (squid-3.1.0.9.tar.bz2) = 221cc189c1c69e61819540ceb798ded728c2579a
4RMD160 (squid-3.1.0.9.tar.bz2) = 208ec13315ba73e16f3f4051e41aa7a539d7ba45 4RMD160 (squid-3.1.0.9.tar.bz2) = 208ec13315ba73e16f3f4051e41aa7a539d7ba45
5Size (squid-3.1.0.9.tar.bz2) = 2360740 bytes 5Size (squid-3.1.0.9.tar.bz2) = 2360740 bytes
 6SHA1 (patch-aa) = 58f69e9172a218cd79d43c09b9065aafe386e8c2
6SHA1 (patch-ad) = 031e5de714610917ac0c575b42add980c0933c72 7SHA1 (patch-ad) = 031e5de714610917ac0c575b42add980c0933c72
7SHA1 (patch-ae) = a512f1d521f3019e2136b5d0ad2199182e2aaabb 8SHA1 (patch-ae) = a512f1d521f3019e2136b5d0ad2199182e2aaabb
8SHA1 (patch-ah) = e20f7b76d6d48041efbfe1a07dce756a818e6642 9SHA1 (patch-ah) = e20f7b76d6d48041efbfe1a07dce756a818e6642
9SHA1 (patch-aj) = 349b5d49dec49430cff2a170ad53d3a16f2a4c76 10SHA1 (patch-aj) = 349b5d49dec49430cff2a170ad53d3a16f2a4c76
10SHA1 (patch-al) = 6dd09cf75ed53a92616f4eed9f3e290232ff54a5 11SHA1 (patch-al) = 6dd09cf75ed53a92616f4eed9f3e290232ff54a5
11SHA1 (patch-am) = 9dcfc9431d4397b87a72e0205487d89f9fa67233 12SHA1 (patch-am) = 9dcfc9431d4397b87a72e0205487d89f9fa67233

File Added: pkgsrc/www/squid31/patches/Attic/patch-aa
$NetBSD: patch-aa,v 1.3 2009/07/12 09:45:02 tron Exp $

Fix problems with anonymous FTP, see here:
http://www.squid-cache.org/bugs/show_bug.cgi?id=2707

--- src/ftp.cc.orig	2009-06-26 11:35:38.000000000 +0100
+++ src/ftp.cc	2009-07-12 10:34:01.000000000 +0100
@@ -93,13 +93,21 @@
 
 /// \ingroup ServerProtocolFTPInternal
 struct _ftp_flags {
+
+    /* passive mode */
+    bool pasv_supported;  ///< PASV command is allowed
+    bool epsv_all_sent;   ///< EPSV ALL has been used. Must abort on failures.
+    bool pasv_only;
+
+    /* authentication */
+    bool authenticated;         ///< authentication success
+    bool tried_auth_anonymous;  ///< auth has tried to use anonymous credentials already.
+    bool tried_auth_nopass;     ///< auth tried username with no password already.
+
+    /* other */
     bool isdir;
-    bool pasv_supported;
-    bool epsv_all_sent;
     bool skip_whitespace;
     bool rest_supported;
-    bool pasv_only;
-    bool authenticated;
     bool http_header_sent;
     bool tried_nlst;
     bool need_base_href;
@@ -1432,6 +1440,9 @@
  *
  * Special Case: A username-only may be provided in the URL and password in the HTTP headers.
  *
+ * TODO: we might be able to do something about locating username from other sources:
+ *       ie, external ACL user=* tag or ident lookup
+ *
  \retval 1	if we have everything needed to complete this request.
  \retval 0	if something is missing.
  */
@@ -1464,10 +1475,16 @@
     /* Setup default FTP password settings */
     /* this has to be done last so that we can have a no-password case above. */
     if (!password[0]) {
-        if (strcmp(user, "anonymous") == 0)
+        if (strcmp(user, "anonymous") == 0 && !flags.tried_auth_anonymous) {
             xstrncpy(password, Config.Ftp.anon_user, MAX_URL);
-        else
+            flags.tried_auth_anonymous=1;
+            return 1;
+        }
+        else if (!flags.tried_auth_nopass) {
             xstrncpy(password, null_string, MAX_URL);
+            flags.tried_auth_nopass=1;
+            return 1;
+        }
     }
 
     return 0;			/* different username */