diff -u -r -N squid-3.0.STABLE5/acinclude.m4 squid-3.0.STABLE6/acinclude.m4
--- squid-3.0.STABLE5/acinclude.m4	2008-04-29 15:43:22.000000000 +1200
+++ squid-3.0.STABLE6/acinclude.m4	2008-05-21 03:01:06.000000000 +1200
@@ -22,6 +22,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 ]])     
 
 dnl and this is for AC_CHECK_SIZEOF
@@ -42,6 +45,9 @@
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
 #if HAVE_NETINET_IP_COMPAT_H
 #include <netinet/ip_compat.h>
 #endif
diff -u -r -N squid-3.0.STABLE5/ChangeLog squid-3.0.STABLE6/ChangeLog
--- squid-3.0.STABLE5/ChangeLog	2008-04-29 15:43:22.000000000 +1200
+++ squid-3.0.STABLE6/ChangeLog	2008-05-21 03:01:06.000000000 +1200
@@ -1,3 +1,16 @@
+Changes to squid-3.0.STABLE6 (20 May 2008):
+
+	- Bug 2254: umask Feature from 2.6 added
+	- cachemgr.cgi default config file added
+	- Several authentication bug fixes
+	- Improved Windows Support
+	- better DNS lookup methods for unqualified hostames
+	- better support for 64-bit environments
+	- Bug 2332: Crash when tunnelling
+	- Removed the advertisement clause from BSD licenses
+	  according to the GPLv2+ changes in BSD
+	- ... and other bugs and minor cleanups
+
 Changes to squid-3.0.STABLE5 (28 Apr 2008):
 
 	- Support for resolv.conf 'domain' option
diff -u -r -N squid-3.0.STABLE5/configure squid-3.0.STABLE6/configure
--- squid-3.0.STABLE5/configure	2008-04-29 15:43:33.000000000 +1200
+++ squid-3.0.STABLE6/configure	2008-05-21 03:01:16.000000000 +1200
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.in Revision: 1.488.2.3 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for Squid Web Proxy 3.0.STABLE5.
+# Generated by GNU Autoconf 2.61 for Squid Web Proxy 3.0.STABLE6.
 #
 # Report bugs to <http://www.squid-cache.org/bugs/>.
 #
@@ -729,8 +729,8 @@
 # Identity of this package.
 PACKAGE_NAME='Squid Web Proxy'
 PACKAGE_TARNAME='squid'
-PACKAGE_VERSION='3.0.STABLE5'
-PACKAGE_STRING='Squid Web Proxy 3.0.STABLE5'
+PACKAGE_VERSION='3.0.STABLE6'
+PACKAGE_STRING='Squid Web Proxy 3.0.STABLE6'
 PACKAGE_BUGREPORT='http://www.squid-cache.org/bugs/'
 
 ac_unique_file="src/main.cc"
@@ -1507,7 +1507,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Squid Web Proxy 3.0.STABLE5 to adapt to many kinds of systems.
+\`configure' configures Squid Web Proxy 3.0.STABLE6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1577,7 +1577,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Squid Web Proxy 3.0.STABLE5:";;
+     short | recursive ) echo "Configuration of Squid Web Proxy 3.0.STABLE6:";;
    esac
   cat <<\_ACEOF
 
@@ -1886,7 +1886,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Squid Web Proxy configure 3.0.STABLE5
+Squid Web Proxy configure 3.0.STABLE6
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1900,7 +1900,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Squid Web Proxy $as_me 3.0.STABLE5, which was
+It was created by Squid Web Proxy $as_me 3.0.STABLE6, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2574,7 +2574,7 @@
 
 # Define the identity of the package.
  PACKAGE='squid'
- VERSION='3.0.STABLE5'
+ VERSION='3.0.STABLE6'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -22101,7 +22101,7 @@
 
 
 if test $needlargefiles && test -z "$buildmodel"; then
-	for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do
+	for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
 		if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
 			buildmodel=$model
 			break
@@ -24236,8 +24236,6 @@
 
 
 
-
-
 for ac_header in \
 	arpa/inet.h \
 	arpa/nameser.h \
@@ -24264,8 +24262,6 @@
 	math.h \
 	memory.h \
 	mount.h \
-	net/if.h \
-	net/pfvar.h \
 	netdb.h \
 	netinet/in.h \
 	netinet/ip_fil_compat.h \
@@ -24508,6 +24504,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 #if HAVE_LIMITS_H
 #include <limits.h>
@@ -24564,10 +24563,17 @@
 
 
 
-for ac_header in net/if.h \
+
+
+
+for ac_header in \
+	net/if.h \
+	net/pfvar.h \
 	netinet/if_ether.h\
+	netinet/ip.h\
 	netinet/ip_compat.h\
 	netinet/ip_fil.h\
+	netinet/ip_icmp.h\
 	netinet/ip_nat.h\
 	netinet/ipl.h \
 	sys/mount.h\
@@ -24608,6 +24614,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
@@ -24618,6 +24627,9 @@
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
 #if HAVE_NETINET_IP_COMPAT_H
 #include <netinet/ip_compat.h>
 #endif
@@ -26339,6 +26351,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef int8_t ac__type_new_;
@@ -26419,6 +26434,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26505,6 +26523,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26568,6 +26589,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26648,6 +26672,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26711,6 +26738,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26801,6 +26831,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -26885,6 +26918,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27013,6 +27049,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef char ac__type_new_;
@@ -27093,6 +27132,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27179,6 +27221,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27242,6 +27287,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27322,6 +27370,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27385,6 +27436,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27475,6 +27529,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27559,6 +27616,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27687,6 +27747,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef u_int8_t ac__type_new_;
@@ -27767,6 +27830,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27853,6 +27919,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27916,6 +27985,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -27996,6 +28068,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28059,6 +28134,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28149,6 +28227,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28233,6 +28314,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28361,6 +28445,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef uint8_t ac__type_new_;
@@ -28441,6 +28528,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28527,6 +28617,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28590,6 +28683,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28670,6 +28766,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28733,6 +28832,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28823,6 +28925,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -28907,6 +29012,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29035,6 +29143,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef int16_t ac__type_new_;
@@ -29115,6 +29226,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29201,6 +29315,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29264,6 +29381,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29344,6 +29464,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29407,6 +29530,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29497,6 +29623,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29581,6 +29710,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29709,6 +29841,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef short ac__type_new_;
@@ -29789,6 +29924,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29875,6 +30013,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -29938,6 +30079,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30018,6 +30162,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30081,6 +30228,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30171,6 +30321,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30255,6 +30408,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30383,6 +30539,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef int ac__type_new_;
@@ -30463,6 +30622,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30549,6 +30711,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30612,6 +30777,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30692,6 +30860,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30755,6 +30926,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30845,6 +31019,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -30929,6 +31106,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31057,6 +31237,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef u_int16_t ac__type_new_;
@@ -31137,6 +31320,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31223,6 +31409,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31286,6 +31475,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31366,6 +31558,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31429,6 +31624,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31519,6 +31717,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31603,6 +31804,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31731,6 +31935,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef uint16_t ac__type_new_;
@@ -31811,6 +32018,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31897,6 +32107,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -31960,6 +32173,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32040,6 +32256,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32103,6 +32322,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32193,6 +32415,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32277,6 +32502,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32405,6 +32633,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef int32_t ac__type_new_;
@@ -32485,6 +32716,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32571,6 +32805,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32634,6 +32871,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32714,6 +32954,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32777,6 +33020,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32867,6 +33113,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -32951,6 +33200,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33079,6 +33331,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef long ac__type_new_;
@@ -33159,6 +33414,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33245,6 +33503,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33308,6 +33569,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33388,6 +33652,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33451,6 +33718,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33541,6 +33811,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33625,6 +33898,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33753,6 +34029,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef u_int32_t ac__type_new_;
@@ -33833,6 +34112,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33919,6 +34201,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -33982,6 +34267,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34062,6 +34350,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34125,6 +34416,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34215,6 +34509,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34299,6 +34596,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34427,6 +34727,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef uint32_t ac__type_new_;
@@ -34507,6 +34810,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34593,6 +34899,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34656,6 +34965,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34736,6 +35048,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34799,6 +35114,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34889,6 +35207,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -34973,6 +35294,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35101,6 +35425,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef int64_t ac__type_new_;
@@ -35181,6 +35508,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35267,6 +35597,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35330,6 +35663,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35410,6 +35746,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35473,6 +35812,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35563,6 +35905,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35647,6 +35992,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35775,6 +36123,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef __int64 ac__type_new_;
@@ -35855,6 +36206,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -35941,6 +36295,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36004,6 +36361,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36084,6 +36444,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36147,6 +36510,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36237,6 +36603,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36321,6 +36690,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36449,6 +36821,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef long long ac__type_new_;
@@ -36529,6 +36904,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36615,6 +36993,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36678,6 +37059,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36758,6 +37142,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36821,6 +37208,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36911,6 +37301,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -36995,6 +37388,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37123,6 +37519,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef u_int64_t ac__type_new_;
@@ -37203,6 +37602,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37289,6 +37691,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37352,6 +37757,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37432,6 +37840,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37495,6 +37906,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37585,6 +37999,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37669,6 +38086,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37797,6 +38217,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef uint64_t ac__type_new_;
@@ -37877,6 +38300,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -37963,6 +38389,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38026,6 +38455,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38106,6 +38538,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38169,6 +38604,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38259,6 +38697,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38343,6 +38784,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38471,6 +38915,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef pad128_t ac__type_new_;
@@ -38556,6 +39003,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef upad128_t ac__type_new_;
@@ -38641,6 +39091,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef pid_t ac__type_new_;
@@ -38725,6 +39178,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef size_t ac__type_new_;
@@ -38804,6 +39260,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38890,6 +39349,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -38953,6 +39415,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39033,6 +39498,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39096,6 +39564,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39186,6 +39657,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39270,6 +39744,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39396,6 +39873,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef ssize_t ac__type_new_;
@@ -39480,6 +39960,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef off_t ac__type_new_;
@@ -39559,6 +40042,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39645,6 +40131,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39708,6 +40197,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39788,6 +40280,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39851,6 +40346,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -39941,6 +40439,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -40025,6 +40526,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 
@@ -40151,6 +40655,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef mode_t ac__type_new_;
@@ -40235,6 +40742,9 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 
 
 typedef fd_mask ac__type_new_;
@@ -43948,7 +44458,12 @@
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
         perror("getrlimit: RLIMIT_NOFILE");
     } else {
+#if defined(__APPLE__)
+        /* asking for more than OPEN_MAX fails on Leopard */
+        rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
+#else
         rl.rlim_cur = rl.rlim_max;      /* set it to the max */
+#endif
         if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
             perror("setrlimit: RLIMIT_NOFILE");
         }
@@ -44768,7 +45283,7 @@
 
 rm -f core
 
-ac_config_files="$ac_config_files Makefile lib/Makefile scripts/Makefile scripts/RunCache scripts/RunAccel src/Makefile src/fs/Makefile src/repl/Makefile src/auth/Makefile contrib/Makefile snmplib/Makefile icons/Makefile errors/Makefile test-suite/Makefile doc/Makefile helpers/Makefile helpers/basic_auth/Makefile helpers/basic_auth/LDAP/Makefile helpers/basic_auth/MSNT/Makefile helpers/basic_auth/NCSA/Makefile helpers/basic_auth/PAM/Makefile helpers/basic_auth/SMB/Makefile helpers/basic_auth/mswin_sspi/Makefile helpers/basic_auth/YP/Makefile helpers/basic_auth/getpwnam/Makefile helpers/basic_auth/multi-domain-NTLM/Makefile helpers/basic_auth/SASL/Makefile helpers/basic_auth/POP3/Makefile helpers/basic_auth/DB/Makefile helpers/basic_auth/squid_radius_auth/Makefile helpers/digest_auth/Makefile helpers/digest_auth/password/Makefile helpers/digest_auth/ldap/Makefile helpers/digest_auth/eDirectory/Makefile helpers/ntlm_auth/Makefile helpers/ntlm_auth/fakeauth/Makefile helpers/ntlm_auth/no_check/Makefile helpers/ntlm_auth/SMB/Makefile helpers/ntlm_auth/SMB/smbval/Makefile helpers/ntlm_auth/mswin_sspi/Makefile helpers/negotiate_auth/Makefile helpers/negotiate_auth/mswin_sspi/Makefile helpers/negotiate_auth/squid_kerb_auth/Makefile helpers/external_acl/Makefile helpers/external_acl/ip_user/Makefile helpers/external_acl/ldap_group/Makefile helpers/external_acl/session/Makefile helpers/external_acl/unix_group/Makefile helpers/external_acl/wbinfo_group/Makefile helpers/external_acl/mswin_lm_group/Makefile tools/Makefile"
+ac_config_files="$ac_config_files Makefile lib/Makefile scripts/Makefile scripts/RunCache scripts/RunAccel src/Makefile src/fs/Makefile src/repl/Makefile src/auth/Makefile contrib/Makefile snmplib/Makefile icons/Makefile errors/Makefile test-suite/Makefile doc/Makefile helpers/Makefile helpers/basic_auth/Makefile helpers/basic_auth/LDAP/Makefile helpers/basic_auth/MSNT/Makefile helpers/basic_auth/NCSA/Makefile helpers/basic_auth/PAM/Makefile helpers/basic_auth/SMB/Makefile helpers/basic_auth/mswin_sspi/Makefile helpers/basic_auth/YP/Makefile helpers/basic_auth/getpwnam/Makefile helpers/basic_auth/multi-domain-NTLM/Makefile helpers/basic_auth/SASL/Makefile helpers/basic_auth/POP3/Makefile helpers/basic_auth/DB/Makefile helpers/basic_auth/squid_radius_auth/Makefile helpers/digest_auth/Makefile helpers/digest_auth/password/Makefile helpers/digest_auth/ldap/Makefile helpers/digest_auth/eDirectory/Makefile helpers/ntlm_auth/Makefile helpers/ntlm_auth/fakeauth/Makefile helpers/ntlm_auth/no_check/Makefile helpers/ntlm_auth/SMB/Makefile helpers/ntlm_auth/SMB/smbval/Makefile helpers/ntlm_auth/mswin_sspi/Makefile helpers/negotiate_auth/Makefile helpers/negotiate_auth/mswin_sspi/Makefile helpers/negotiate_auth/squid_kerb_auth/Makefile helpers/external_acl/Makefile helpers/external_acl/ip_user/Makefile helpers/external_acl/ldap_group/Makefile helpers/external_acl/session/Makefile helpers/external_acl/unix_group/Makefile helpers/external_acl/wbinfo_group/Makefile helpers/external_acl/mswin_ad_group/Makefile helpers/external_acl/mswin_lm_group/Makefile tools/Makefile"
 
 
 subdirs="$subdirs lib/libTrie"
@@ -45492,7 +46007,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Squid Web Proxy $as_me 3.0.STABLE5, which was
+This file was extended by Squid Web Proxy $as_me 3.0.STABLE6, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -45545,7 +46060,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-Squid Web Proxy config.status 3.0.STABLE5
+Squid Web Proxy config.status 3.0.STABLE6
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -45709,6 +46224,7 @@
     "helpers/external_acl/session/Makefile") CONFIG_FILES="$CONFIG_FILES helpers/external_acl/session/Makefile" ;;
     "helpers/external_acl/unix_group/Makefile") CONFIG_FILES="$CONFIG_FILES helpers/external_acl/unix_group/Makefile" ;;
     "helpers/external_acl/wbinfo_group/Makefile") CONFIG_FILES="$CONFIG_FILES helpers/external_acl/wbinfo_group/Makefile" ;;
+    "helpers/external_acl/mswin_ad_group/Makefile") CONFIG_FILES="$CONFIG_FILES helpers/external_acl/mswin_ad_group/Makefile" ;;
     "helpers/external_acl/mswin_lm_group/Makefile") CONFIG_FILES="$CONFIG_FILES helpers/external_acl/mswin_lm_group/Makefile" ;;
     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
 
diff -u -r -N squid-3.0.STABLE5/configure.in squid-3.0.STABLE6/configure.in
--- squid-3.0.STABLE5/configure.in	2008-04-29 15:43:33.000000000 +1200
+++ squid-3.0.STABLE6/configure.in	2008-05-21 03:01:16.000000000 +1200
@@ -5,7 +5,7 @@
 dnl
 dnl
 dnl
-AC_INIT(Squid Web Proxy, 3.0.STABLE5, http://www.squid-cache.org/bugs/, squid)
+AC_INIT(Squid Web Proxy, 3.0.STABLE6, http://www.squid-cache.org/bugs/, squid)
 AC_PREREQ(2.52)
 AM_CONFIG_HEADER(include/autoconf.h)
 AC_CONFIG_AUX_DIR(cfgaux)
@@ -1165,7 +1165,7 @@
 ])
 
 if test $needlargefiles && test -z "$buildmodel"; then
-	for model in POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG; do
+	for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do
 		if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then
 			buildmodel=$model
 			break
@@ -1862,8 +1862,6 @@
 	math.h \
 	memory.h \
 	mount.h \
-	net/if.h \
-	net/pfvar.h \
 	netdb.h \
 	netinet/in.h \
 	netinet/ip_fil_compat.h \
@@ -1933,10 +1931,16 @@
 #endif
 )
 
-AC_CHECK_HEADERS(net/if.h \
+dnl *BSD dont include the depenencies for all their net/ and netinet/ files
+dnl We must include a few basic type headers for them to work.
+AC_CHECK_HEADERS( \
+	net/if.h \
+	net/pfvar.h \
 	netinet/if_ether.h\
+	netinet/ip.h\
 	netinet/ip_compat.h\
 	netinet/ip_fil.h\
+	netinet/ip_icmp.h\
 	netinet/ip_nat.h\
 	netinet/ipl.h \
 	sys/mount.h\
@@ -2954,7 +2958,12 @@
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
         perror("getrlimit: RLIMIT_NOFILE");
     } else {
+#if defined(__APPLE__)
+        /* asking for more than OPEN_MAX fails on Leopard */
+        rl.rlim_cur = (OPEN_MAX < rl.rlim_max ? OPEN_MAX : rl.rlim_max);
+#else
         rl.rlim_cur = rl.rlim_max;      /* set it to the max */
+#endif
         if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
             perror("setrlimit: RLIMIT_NOFILE");
         }
@@ -3330,6 +3339,7 @@
 	helpers/external_acl/session/Makefile \
 	helpers/external_acl/unix_group/Makefile \
 	helpers/external_acl/wbinfo_group/Makefile \
+	helpers/external_acl/mswin_ad_group/Makefile \
 	helpers/external_acl/mswin_lm_group/Makefile \
 	tools/Makefile
 ])
diff -u -r -N squid-3.0.STABLE5/CREDITS squid-3.0.STABLE6/CREDITS
--- squid-3.0.STABLE5/CREDITS	2008-04-29 15:43:22.000000000 +1200
+++ squid-3.0.STABLE6/CREDITS	2008-05-21 03:01:06.000000000 +1200
@@ -195,11 +195,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -260,11 +256,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -285,6 +277,47 @@
 
 ==============================================================================
 
+lib/strnstr.cc:
+
+/*-
+ * Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)strstr.c	8.1 (Berkeley) 6/4/93
+ * $FreeBSD: src/lib/libc/string/strnstr.c,v 1.2.2.1 2001/12/09 06:50:03 mike Exp $
+ * $DragonFly: src/lib/libc/string/strnstr.c,v 1.4 2006/03/20 17:24:20 dillon Exp $
+ */
+
+==============================================================================
+
 src/external_acl.c
 
 Copyright (C) 2002 MARA Systems AB, Sweden <info@marasystems.com>
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/MSNT/rfcnb-util.c squid-3.0.STABLE6/helpers/basic_auth/MSNT/rfcnb-util.c
--- squid-3.0.STABLE5/helpers/basic_auth/MSNT/rfcnb-util.c	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/MSNT/rfcnb-util.c	2008-05-21 03:01:10.000000000 +1200
@@ -364,7 +364,7 @@
 	    return (RFCNBE_Bad);
 
 	} else { /* We got a name */
-            Dest_IP->s_addr = ((struct sockaddr_in*)hp->h_addr_list[0])->sin_addr.s_addr;
+            Dest_IP->s_addr = (*((struct in_addr*)hp->h_addr_list[0])).s_addr;
 	}
     } else { /* It was an IP address */
 	Dest_IP->s_addr = addr;
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/Makefile.am squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/Makefile.am
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/Makefile.am	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/Makefile.am	2008-05-21 03:01:11.000000000 +1200
@@ -12,7 +12,8 @@
 squid_radius_auth_SOURCES = \
 			squid_rad_auth.c \
 			radius.h \
-			util.c util.h
+			radius-util.c \
+			radius-util.h
 
 LDADD			= -L$(top_builddir)/lib -lmiscutil $(SSLLIB) $(XTRA_LIBS)
 INCLUDES		= -I$(top_srcdir)/include
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/Makefile.in squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/Makefile.in
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/Makefile.in	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/Makefile.in	2008-05-21 03:01:11.000000000 +1200
@@ -58,7 +58,8 @@
 am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man8dir)"
 libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(libexec_PROGRAMS)
-am_squid_radius_auth_OBJECTS = squid_rad_auth.$(OBJEXT) util.$(OBJEXT)
+am_squid_radius_auth_OBJECTS = squid_rad_auth.$(OBJEXT) \
+	radius-util.$(OBJEXT)
 squid_radius_auth_OBJECTS = $(am_squid_radius_auth_OBJECTS)
 squid_radius_auth_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
@@ -305,7 +306,8 @@
 squid_radius_auth_SOURCES = \
 			squid_rad_auth.c \
 			radius.h \
-			util.c util.h
+			radius-util.c \
+			radius-util.h
 
 LDADD = -L$(top_builddir)/lib -lmiscutil $(SSLLIB) $(XTRA_LIBS)
 INCLUDES = -I$(top_srcdir)/include
@@ -380,8 +382,8 @@
 distclean-compile:
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radius-util.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/squid_rad_auth.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/radius-util.c squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/radius-util.c
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/radius-util.c	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/radius-util.c	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,177 @@
+// 2008-05-14: rename to radius-util.* to avoid name clashes with squid util.*
+/*
+ *
+ *	RADIUS
+ *	Remote Authentication Dial In User Service
+ *
+ *
+ *	Livingston Enterprises, Inc.
+ *	6920 Koll Center Parkway
+ *	Pleasanton, CA   94566
+ *
+ *	Copyright 1992 Livingston Enterprises, Inc.
+ *	Copyright 1997 Cistron Internet Services B.V.
+ *
+ *	Permission to use, copy, modify, and distribute this software for any
+ *	purpose and without fee is hereby granted, provided that this
+ *	copyright and permission notice appear on all copies and supporting
+ *	documentation, the name of Livingston Enterprises, Inc. not be used
+ *	in advertising or publicity pertaining to distribution of the
+ *	program without specific prior permission, and notice be given
+ *	in supporting documentation that copying and distribution is by
+ *	permission of Livingston Enterprises, Inc.   
+ *
+ *	Livingston Enterprises, Inc. makes no representations about
+ *	the suitability of this software for any purpose.  It is
+ *	provided "as is" without express or implied warranty.
+ *
+ */
+
+/*
+ * util.c	Miscellanous generic functions.
+ *
+ */
+
+char util_sccsid[] =
+"@(#)util.c	1.5 Copyright 1992 Livingston Enterprises Inc\n"
+"		2.1 Copyright 1997 Cistron Internet Services B.V.";
+
+#include	"config.h"
+
+#if HAVE_SYS_TYES_H
+#include	<sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include	<sys/socket.h>
+#endif
+#if HAVE_SYS_TIME_H
+#include	<sys/time.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include	<netinet/in.h>
+#endif
+
+#if HAVE_STDIO_H
+#include	<stdio.h>
+#endif
+#if HAVE_STDLIB_H
+#include	<stdlib.h>
+#endif
+#if HAVE_NETDB_H
+#include	<netdb.h>
+#endif
+#if HAVE_PWD_H
+#include	<pwd.h>
+#endif
+#if HAVE_TIME_H
+#include	<time.h>
+#endif
+#if HAVE_CTYPE_H
+#include	<ctype.h>
+#endif
+#if HAVE_SIGNAL_H
+#include	<signal.h>
+#endif
+
+#include	"md5.h"
+#include	"radius-util.h"
+
+/*
+ *	Check for valid IP address in standard dot notation.
+ */
+static int good_ipaddr(char *addr)
+{
+	int	dot_count;
+	int	digit_count;
+
+	dot_count = 0;
+	digit_count = 0;
+	while(*addr != '\0' && *addr != ' ') {
+		if(*addr == '.') {
+			dot_count++;
+			digit_count = 0;
+		}
+		else if(!isdigit(*addr)) {
+			dot_count = 5;
+		}
+		else {
+			digit_count++;
+			if(digit_count > 3) {
+				dot_count = 5;
+			}
+		}
+		addr++;
+	}
+	if(dot_count != 3) {
+		return(-1);
+	}
+	else {
+		return(0);
+	}
+}
+
+/*
+ *	Return an IP address in host long notation from
+ *	one supplied in standard dot notation.
+ */
+static u_int32_t ipstr2long(char *ip_str)
+{
+	char	buf[6];
+	char	*ptr;
+	int	i;
+	int	count;
+	u_int32_t	ipaddr;
+	int	cur_byte;
+
+	ipaddr = (u_int32_t)0;
+	for(i = 0;i < 4;i++) {
+		ptr = buf;
+		count = 0;
+		*ptr = '\0';
+		while(*ip_str != '.' && *ip_str != '\0' && count < 4) {
+			if(!isdigit(*ip_str)) {
+				return((u_int32_t)0);
+			}
+			*ptr++ = *ip_str++;
+			count++;
+		}
+		if(count >= 4 || count == 0) {
+			return((u_int32_t)0);
+		}
+		*ptr = '\0';
+		cur_byte = atoi(buf);
+		if(cur_byte < 0 || cur_byte > 255) {
+			return((u_int32_t)0);
+		}
+		ip_str++;
+		ipaddr = ipaddr << 8 | (u_int32_t)cur_byte;
+	}
+	return(ipaddr);
+}
+
+/*
+ *	Return an IP address in host long notation from a host
+ *	name or address in dot notation.
+ */
+u_int32_t get_ipaddr(char *host)
+{
+	struct hostent	*hp;
+
+	if(good_ipaddr(host) == 0) {
+		return(ipstr2long(host));
+	}
+	else if((hp = gethostbyname(host)) == (struct hostent *)NULL) {
+		return((u_int32_t)0);
+	}
+	return(ntohl(*(u_int32_t *)hp->h_addr));
+}
+
+
+void md5_calc(unsigned char *output, unsigned char *input, unsigned int inlen)
+{
+	SquidMD5_CTX	context;
+
+	SquidMD5Init(&context);
+	SquidMD5Update(&context, input, inlen);
+	SquidMD5Final(output, &context);
+}
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/radius-util.h squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/radius-util.h
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/radius-util.h	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/radius-util.h	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,7 @@
+// 2008-05-14: rename to radius-util.* to avoid name clashes with squid util.*
+
+// uses the squid utilities
+#include "util.h"
+
+/* util.c */
+u_int32_t		get_ipaddr (char *);
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/squid_rad_auth.c	2008-05-21 03:01:11.000000000 +1200
@@ -93,7 +93,7 @@
 
 #include	"md5.h"
 #include	"radius.h"
-#include	"util.h"
+#include	"radius-util.h"
 
 #define MAXPWNAM	254
 #define MAXPASS		254
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/util.c squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/util.c
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/util.c	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/util.c	1970-01-01 12:00:00.000000000 +1200
@@ -1,177 +0,0 @@
-/*
- *
- *	RADIUS
- *	Remote Authentication Dial In User Service
- *
- *
- *	Livingston Enterprises, Inc.
- *	6920 Koll Center Parkway
- *	Pleasanton, CA   94566
- *
- *	Copyright 1992 Livingston Enterprises, Inc.
- *	Copyright 1997 Cistron Internet Services B.V.
- *
- *	Permission to use, copy, modify, and distribute this software for any
- *	purpose and without fee is hereby granted, provided that this
- *	copyright and permission notice appear on all copies and supporting
- *	documentation, the name of Livingston Enterprises, Inc. not be used
- *	in advertising or publicity pertaining to distribution of the
- *	program without specific prior permission, and notice be given
- *	in supporting documentation that copying and distribution is by
- *	permission of Livingston Enterprises, Inc.   
- *
- *	Livingston Enterprises, Inc. makes no representations about
- *	the suitability of this software for any purpose.  It is
- *	provided "as is" without express or implied warranty.
- *
- */
-
-/*
- * util.c	Miscellanous generic functions.
- *
- */
-
-char util_sccsid[] =
-"@(#)util.c	1.5 Copyright 1992 Livingston Enterprises Inc\n"
-"		2.1 Copyright 1997 Cistron Internet Services B.V.";
-
-#include	"config.h"
-
-#if HAVE_SYS_TYES_H
-#include	<sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET_H
-#include	<sys/socket.h>
-#endif
-#if HAVE_SYS_TIME_H
-#include	<sys/time.h>
-#endif
-#if HAVE_NETINET_IN_H
-#include	<netinet/in.h>
-#endif
-
-#if HAVE_STDIO_H
-#include	<stdio.h>
-#endif
-#if HAVE_STDLIB_H
-#include	<stdlib.h>
-#endif
-#if HAVE_NETDB_H
-#include	<netdb.h>
-#endif
-#if HAVE_PWD_H
-#include	<pwd.h>
-#endif
-#if HAVE_TIME_H
-#include	<time.h>
-#endif
-#if HAVE_CTYPE_H
-#include	<ctype.h>
-#endif
-#if HAVE_SIGNAL_H
-#include	<signal.h>
-#endif
-
-#include	"md5.h"
-#include	"util.h"
-
-/*
- *	Check for valid IP address in standard dot notation.
- */
-static int good_ipaddr(char *addr)
-{
-	int	dot_count;
-	int	digit_count;
-
-	dot_count = 0;
-	digit_count = 0;
-	while(*addr != '\0' && *addr != ' ') {
-		if(*addr == '.') {
-			dot_count++;
-			digit_count = 0;
-		}
-		else if(!isdigit(*addr)) {
-			dot_count = 5;
-		}
-		else {
-			digit_count++;
-			if(digit_count > 3) {
-				dot_count = 5;
-			}
-		}
-		addr++;
-	}
-	if(dot_count != 3) {
-		return(-1);
-	}
-	else {
-		return(0);
-	}
-}
-
-/*
- *	Return an IP address in host long notation from
- *	one supplied in standard dot notation.
- */
-static u_int32_t ipstr2long(char *ip_str)
-{
-	char	buf[6];
-	char	*ptr;
-	int	i;
-	int	count;
-	u_int32_t	ipaddr;
-	int	cur_byte;
-
-	ipaddr = (u_int32_t)0;
-	for(i = 0;i < 4;i++) {
-		ptr = buf;
-		count = 0;
-		*ptr = '\0';
-		while(*ip_str != '.' && *ip_str != '\0' && count < 4) {
-			if(!isdigit(*ip_str)) {
-				return((u_int32_t)0);
-			}
-			*ptr++ = *ip_str++;
-			count++;
-		}
-		if(count >= 4 || count == 0) {
-			return((u_int32_t)0);
-		}
-		*ptr = '\0';
-		cur_byte = atoi(buf);
-		if(cur_byte < 0 || cur_byte > 255) {
-			return((u_int32_t)0);
-		}
-		ip_str++;
-		ipaddr = ipaddr << 8 | (u_int32_t)cur_byte;
-	}
-	return(ipaddr);
-}
-
-/*
- *	Return an IP address in host long notation from a host
- *	name or address in dot notation.
- */
-u_int32_t get_ipaddr(char *host)
-{
-	struct hostent	*hp;
-
-	if(good_ipaddr(host) == 0) {
-		return(ipstr2long(host));
-	}
-	else if((hp = gethostbyname(host)) == (struct hostent *)NULL) {
-		return((u_int32_t)0);
-	}
-	return(ntohl(*(u_int32_t *)hp->h_addr));
-}
-
-
-void md5_calc(unsigned char *output, unsigned char *input, unsigned int inlen)
-{
-	SquidMD5_CTX	context;
-
-	SquidMD5Init(&context);
-	SquidMD5Update(&context, input, inlen);
-	SquidMD5Final(output, &context);
-}
-
diff -u -r -N squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/util.h squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/util.h
--- squid-3.0.STABLE5/helpers/basic_auth/squid_radius_auth/util.h	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/basic_auth/squid_radius_auth/util.h	1970-01-01 12:00:00.000000000 +1200
@@ -1,2 +0,0 @@
-/* util.c */
-u_int32_t		get_ipaddr (char *);
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/Makefile.am squid-3.0.STABLE6/helpers/external_acl/Makefile.am
--- squid-3.0.STABLE5/helpers/external_acl/Makefile.am	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/Makefile.am	2008-05-21 03:01:11.000000000 +1200
@@ -3,5 +3,5 @@
 #  $Id: Makefile.am,v 1.6 2006/03/19 01:30:30 hno Exp $
 #
 
-DIST_SUBDIRS	= ip_user ldap_group session unix_group wbinfo_group mswin_lm_group
+DIST_SUBDIRS	= ip_user ldap_group mswin_ad_group mswin_lm_group session unix_group wbinfo_group
 SUBDIRS		= @EXTERNAL_ACL_HELPERS@
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/Makefile.in squid-3.0.STABLE6/helpers/external_acl/Makefile.in
--- squid-3.0.STABLE5/helpers/external_acl/Makefile.in	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/Makefile.in	2008-05-21 03:01:11.000000000 +1200
@@ -278,7 +278,7 @@
 subdirs = @subdirs@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-DIST_SUBDIRS = ip_user ldap_group session unix_group wbinfo_group mswin_lm_group
+DIST_SUBDIRS = ip_user ldap_group mswin_ad_group mswin_lm_group session unix_group wbinfo_group
 SUBDIRS = @EXTERNAL_ACL_HELPERS@
 all: all-recursive
 
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/Makefile.am squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/Makefile.am
--- squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/Makefile.am	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/Makefile.am	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,19 @@
+#
+#  Makefile for the Squid Object Cache server
+#
+#  $Id: Makefile.am,v 1.1 2008/05/17 10:23:13 serassio Exp $
+#
+#  Uncomment and customize the following to suit your needs:
+#
+
+
+libexec_PROGRAMS = mswin_check_ad_group
+
+mswin_check_ad_group_SOURCES = mswin_check_ad_group.c mswin_check_ad_group.h
+
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src
+
+LDADD   = -L$(top_builddir)/lib -lmiscutil -lnetapi32 -ladvapi32 \
+          -lntdll $(XTRA_LIBS)
+
+EXTRA_DIST = readme.txt
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/Makefile.in squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/Makefile.in
--- squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/Makefile.in	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/Makefile.in	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,581 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+#  Makefile for the Squid Object Cache server
+#
+#  $Id: Makefile.am,v 1.1 2008/05/17 10:23:13 serassio Exp $
+#
+#  Uncomment and customize the following to suit your needs:
+#
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+libexec_PROGRAMS = mswin_check_ad_group$(EXEEXT)
+subdir = helpers/external_acl/mswin_ad_group
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/autoconf.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(libexecdir)"
+libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(libexec_PROGRAMS)
+am_mswin_check_ad_group_OBJECTS = mswin_check_ad_group.$(OBJEXT)
+mswin_check_ad_group_OBJECTS = $(am_mswin_check_ad_group_OBJECTS)
+mswin_check_ad_group_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+mswin_check_ad_group_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(mswin_check_ad_group_SOURCES)
+DIST_SOURCES = $(mswin_check_ad_group_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AR_R = @AR_R@
+AUTH_LIBS = @AUTH_LIBS@
+AUTH_LINKOBJS = @AUTH_LINKOBJS@
+AUTH_MODULES = @AUTH_MODULES@
+AUTH_OBJS = @AUTH_OBJS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BASIC_AUTH_HELPERS = @BASIC_AUTH_HELPERS@
+CACHE_EFFECTIVE_USER = @CACHE_EFFECTIVE_USER@
+CACHE_HTTP_PORT = @CACHE_HTTP_PORT@
+CACHE_ICP_PORT = @CACHE_ICP_PORT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CGIEXT = @CGIEXT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNITCONFIG = @CPPUNITCONFIG@
+CRYPTLIB = @CRYPTLIB@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIGEST_AUTH_HELPERS = @DIGEST_AUTH_HELPERS@
+DISK_LIBS = @DISK_LIBS@
+DISK_LINKOBJS = @DISK_LINKOBJS@
+DISK_PROGRAMS = @DISK_PROGRAMS@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_ARP_ACL_FALSE = @ENABLE_ARP_ACL_FALSE@
+ENABLE_ARP_ACL_TRUE = @ENABLE_ARP_ACL_TRUE@
+ENABLE_HTCP_FALSE = @ENABLE_HTCP_FALSE@
+ENABLE_HTCP_TRUE = @ENABLE_HTCP_TRUE@
+ENABLE_IDENT_FALSE = @ENABLE_IDENT_FALSE@
+ENABLE_IDENT_TRUE = @ENABLE_IDENT_TRUE@
+ENABLE_PINGER_FALSE = @ENABLE_PINGER_FALSE@
+ENABLE_PINGER_TRUE = @ENABLE_PINGER_TRUE@
+ENABLE_SSL_FALSE = @ENABLE_SSL_FALSE@
+ENABLE_SSL_TRUE = @ENABLE_SSL_TRUE@
+ENABLE_UNLINKD_FALSE = @ENABLE_UNLINKD_FALSE@
+ENABLE_UNLINKD_TRUE = @ENABLE_UNLINKD_TRUE@
+ENABLE_WIN32SPECIFIC_FALSE = @ENABLE_WIN32SPECIFIC_FALSE@
+ENABLE_WIN32SPECIFIC_TRUE = @ENABLE_WIN32SPECIFIC_TRUE@
+ENABLE_XPROF_STATS_FALSE = @ENABLE_XPROF_STATS_FALSE@
+ENABLE_XPROF_STATS_TRUE = @ENABLE_XPROF_STATS_TRUE@
+EPOLL_LIBS = @EPOLL_LIBS@
+ERR_DEFAULT_LANGUAGE = @ERR_DEFAULT_LANGUAGE@
+ERR_LANGUAGES = @ERR_LANGUAGES@
+EXEEXT = @EXEEXT@
+EXTERNAL_ACL_HELPERS = @EXTERNAL_ACL_HELPERS@
+F77 = @F77@
+FALSE = @FALSE@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+ICAP_LIBS = @ICAP_LIBS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBADD_DL = @LIBADD_DL@
+LIBOBJS = @LIBOBJS@
+LIBREGEX = @LIBREGEX@
+LIBS = @LIBS@
+LIBSASL = @LIBSASL@
+LIBTOOL = @LIBTOOL@
+LIB_DB = @LIB_DB@
+LIB_LBER = @LIB_LBER@
+LIB_LDAP = @LIB_LDAP@
+LN = @LN@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MAKE_LEAKFINDER_FALSE = @MAKE_LEAKFINDER_FALSE@
+MAKE_LEAKFINDER_TRUE = @MAKE_LEAKFINDER_TRUE@
+MINGW_LIBS = @MINGW_LIBS@
+MKDIR = @MKDIR@
+MV = @MV@
+NEED_OWN_STRSEP_FALSE = @NEED_OWN_STRSEP_FALSE@
+NEED_OWN_STRSEP_TRUE = @NEED_OWN_STRSEP_TRUE@
+NEED_OWN_STRTOLL_FALSE = @NEED_OWN_STRTOLL_FALSE@
+NEED_OWN_STRTOLL_TRUE = @NEED_OWN_STRTOLL_TRUE@
+NEGOTIATE_AUTH_HELPERS = @NEGOTIATE_AUTH_HELPERS@
+NTLM_AUTH_HELPERS = @NTLM_AUTH_HELPERS@
+OBJEXT = @OBJEXT@
+OPT_DEFAULT_HOSTS = @OPT_DEFAULT_HOSTS@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+RANLIB = @RANLIB@
+REGEXLIB = @REGEXLIB@
+REPL_LIBS = @REPL_LIBS@
+REPL_OBJS = @REPL_OBJS@
+REPL_POLICIES = @REPL_POLICIES@
+RM = @RM@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SH = @SH@
+SHELL = @SHELL@
+SNMPLIB = @SNMPLIB@
+SQUID_CFLAGS = @SQUID_CFLAGS@
+SQUID_CPPUNIT_INC = @SQUID_CPPUNIT_INC@
+SQUID_CPPUNIT_LA = @SQUID_CPPUNIT_LA@
+SQUID_CPPUNIT_LIBS = @SQUID_CPPUNIT_LIBS@
+SQUID_CXXFLAGS = @SQUID_CXXFLAGS@
+SSLLIB = @SSLLIB@
+STORE_LIBS = @STORE_LIBS@
+STORE_LINKOBJS = @STORE_LINKOBJS@
+STORE_OBJS = @STORE_OBJS@
+STORE_TESTS = @STORE_TESTS@
+STRIP = @STRIP@
+TRUE = @TRUE@
+USE_AIOPS_WIN32_FALSE = @USE_AIOPS_WIN32_FALSE@
+USE_AIOPS_WIN32_TRUE = @USE_AIOPS_WIN32_TRUE@
+USE_AIO_WIN32_FALSE = @USE_AIO_WIN32_FALSE@
+USE_AIO_WIN32_TRUE = @USE_AIO_WIN32_TRUE@
+USE_DELAY_POOLS_FALSE = @USE_DELAY_POOLS_FALSE@
+USE_DELAY_POOLS_TRUE = @USE_DELAY_POOLS_TRUE@
+USE_DEVPOLL_FALSE = @USE_DEVPOLL_FALSE@
+USE_DEVPOLL_TRUE = @USE_DEVPOLL_TRUE@
+USE_DNSSERVER_FALSE = @USE_DNSSERVER_FALSE@
+USE_DNSSERVER_TRUE = @USE_DNSSERVER_TRUE@
+USE_EPOLL_FALSE = @USE_EPOLL_FALSE@
+USE_EPOLL_TRUE = @USE_EPOLL_TRUE@
+USE_ESI_FALSE = @USE_ESI_FALSE@
+USE_ESI_TRUE = @USE_ESI_TRUE@
+USE_ICAP_CLIENT_FALSE = @USE_ICAP_CLIENT_FALSE@
+USE_ICAP_CLIENT_TRUE = @USE_ICAP_CLIENT_TRUE@
+USE_IPC_WIN32_FALSE = @USE_IPC_WIN32_FALSE@
+USE_IPC_WIN32_TRUE = @USE_IPC_WIN32_TRUE@
+USE_KQUEUE_FALSE = @USE_KQUEUE_FALSE@
+USE_KQUEUE_TRUE = @USE_KQUEUE_TRUE@
+USE_POLL_FALSE = @USE_POLL_FALSE@
+USE_POLL_TRUE = @USE_POLL_TRUE@
+USE_SELECT_FALSE = @USE_SELECT_FALSE@
+USE_SELECT_SIMPLE_FALSE = @USE_SELECT_SIMPLE_FALSE@
+USE_SELECT_SIMPLE_TRUE = @USE_SELECT_SIMPLE_TRUE@
+USE_SELECT_TRUE = @USE_SELECT_TRUE@
+USE_SELECT_WIN32_FALSE = @USE_SELECT_WIN32_FALSE@
+USE_SELECT_WIN32_TRUE = @USE_SELECT_WIN32_TRUE@
+USE_SNMP_FALSE = @USE_SNMP_FALSE@
+USE_SNMP_TRUE = @USE_SNMP_TRUE@
+VERSION = @VERSION@
+WIN32_PSAPI = @WIN32_PSAPI@
+XTRA_LIBS = @XTRA_LIBS@
+XTRA_OBJS = @XTRA_OBJS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+makesnmplib = @makesnmplib@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+mswin_check_ad_group_SOURCES = mswin_check_ad_group.c mswin_check_ad_group.h
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src
+LDADD = -L$(top_builddir)/lib -lmiscutil -lnetapi32 -ladvapi32 \
+          -lntdll $(XTRA_LIBS)
+
+EXTRA_DIST = readme.txt
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  helpers/external_acl/mswin_ad_group/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  helpers/external_acl/mswin_ad_group/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
+	@list='$(libexec_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	     || test -f $$p1 \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-libexecPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(libexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
+	done
+
+clean-libexecPROGRAMS:
+	@list='$(libexec_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+mswin_check_ad_group$(EXEEXT): $(mswin_check_ad_group_OBJECTS) $(mswin_check_ad_group_DEPENDENCIES) 
+	@rm -f mswin_check_ad_group$(EXEEXT)
+	$(LINK) $(mswin_check_ad_group_LDFLAGS) $(mswin_check_ad_group_OBJECTS) $(mswin_check_ad_group_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mswin_check_ad_group.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(libexecdir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-libexecPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libexecPROGRAMS clean-libtool ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am \
+	install-libexecPROGRAMS install-man install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-info-am \
+	uninstall-libexecPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c
--- squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,485 @@
+/*
+ * mswin_check_ad_group: lookup group membership in a Windows
+ * Active Directory domain
+ *
+ * (C)2008 Guido Serassio - Acme Consulting S.r.l.
+ *
+ * Authors:
+ *  Guido Serassio <guido.serassio@acmeconsulting.it>
+ *  Acme Consulting S.r.l., Italy <http://www.acmeconsulting.it>
+ *
+ * With contributions from others mentioned in the change history section
+ * below.
+ *
+ * Based on mswin_check_lm_group by Guido Serassio.
+ *
+ * Dependencies: Windows 2000 SP4 and later.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ * History:
+ *
+ * Version 1.0
+ * 02-05-2008 Guido Serassio
+ *              First release, based on mswin_check_lm_group.
+ *
+ * This is a helper for the external ACL interface for Squid Cache
+ * 
+ * It reads from the standard input the domain username and a list of
+ * groups and tries to match it against the groups membership of the
+ * specified username.
+ *
+ * Returns `OK' if the user belongs to a group or `ERR' otherwise, as
+ * described on http://devel.squid-cache.org/external_acl/config.html
+ *
+ */
+
+#include "config.h"
+#ifdef _SQUID_CYGWIN_
+#include <wchar.h>
+int _wcsicmp(const wchar_t *, const wchar_t *);
+#endif
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+#undef assert
+#include <assert.h>
+#include <windows.h>
+#include <lm.h>
+#include <dsgetdc.h>
+#include <dsrole.h>
+
+#include "util.h"
+
+#define BUFSIZE 8192		/* the stdin buffer size */
+int use_global = 0;
+char debug_enabled = 0;
+char *myname;
+pid_t mypid;
+char *machinedomain;
+int use_case_insensitive_compare = 0;
+char *DefaultDomain = NULL;
+const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/";
+
+#include "mswin_check_ad_group.h"
+
+
+char *
+GetDomainName(void)
+{
+    static char *DomainName = NULL;
+    PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo;
+    DWORD netret;
+
+    if ((netret = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo) == ERROR_SUCCESS)) {
+	/* 
+	 * Check the machine role.
+	 */
+
+	if ((pDSRoleInfo->MachineRole == DsRole_RoleMemberWorkstation) ||
+	    (pDSRoleInfo->MachineRole == DsRole_RoleMemberServer) ||
+	    (pDSRoleInfo->MachineRole == DsRole_RoleBackupDomainController) ||
+	    (pDSRoleInfo->MachineRole == DsRole_RolePrimaryDomainController)) {
+
+	    size_t len = wcslen(pDSRoleInfo->DomainNameFlat);
+
+	    /* allocate buffer for str + null termination */
+	    safe_free(DomainName);
+	    DomainName = (char *) xmalloc(len + 1);
+	    if (DomainName == NULL)
+		return NULL;
+
+	    /* copy unicode buffer */
+	    WideCharToMultiByte(CP_ACP, 0, pDSRoleInfo->DomainNameFlat, -1, DomainName, len, NULL, NULL);
+
+	    /* add null termination */
+	    DomainName[len] = '\0';
+
+	    /* 
+	     * Member of a domain. Display it in debug mode.
+	     */
+	    debug("Member of Domain %s\n", DomainName);
+	    debug("Into forest %S\n", pDSRoleInfo->DomainForestName);
+
+	} else {
+	    debug("Not a Domain member\n");
+	}
+    } else
+	debug("DsRoleGetPrimaryDomainInformation Error: %ld\n", netret);
+
+    /*
+     * Free the allocated memory.
+     */
+    if (pDSRoleInfo != NULL)
+	DsRoleFreeMemory(pDSRoleInfo);
+
+    return DomainName;
+}
+
+/* returns 0 on match, -1 if no match */
+static int
+wcstrcmparray(const wchar_t * str, const char **array)
+{
+    WCHAR wszGroup[GNLEN + 1];	// Unicode Group
+
+    while (*array) {
+	MultiByteToWideChar(CP_ACP, 0, *array,
+	    strlen(*array) + 1, wszGroup, sizeof(wszGroup) / sizeof(wszGroup[0]));
+	debug("Windows group: %S, Squid group: %S\n", str, wszGroup);
+	if ((use_case_insensitive_compare ? _wcsicmp(str, wszGroup) : wcscmp(str, wszGroup)) == 0)
+	    return 0;
+	array++;
+    }
+    return -1;
+}
+
+/* returns 1 on success, 0 on failure */
+int
+Valid_Local_Groups(char *UserName, const char **Groups)
+{
+    int result = 0;
+    char *Domain_Separator;
+    WCHAR wszUserName[UNLEN + 1];	// Unicode user name
+
+    LPLOCALGROUP_USERS_INFO_0 pBuf;
+    LPLOCALGROUP_USERS_INFO_0 pTmpBuf;
+    DWORD dwLevel = 0;
+    DWORD dwFlags = LG_INCLUDE_INDIRECT;
+    DWORD dwPrefMaxLen = -1;
+    DWORD dwEntriesRead = 0;
+    DWORD dwTotalEntries = 0;
+    NET_API_STATUS nStatus;
+    DWORD i;
+    DWORD dwTotalCount = 0;
+    LPBYTE pBufTmp = NULL;
+
+    if ((Domain_Separator = strchr(UserName, '/')) != NULL)
+	*Domain_Separator = '\\';
+
+    debug("Valid_Local_Groups: checking group membership of '%s'.\n", UserName);
+
+/* Convert ANSI User Name and Group to Unicode */
+
+    MultiByteToWideChar(CP_ACP, 0, UserName,
+	strlen(UserName) + 1, wszUserName, sizeof(wszUserName) / sizeof(wszUserName[0]));
+
+    /*
+     * Call the NetUserGetLocalGroups function 
+     * specifying information level 0.
+     * 
+     * The LG_INCLUDE_INDIRECT flag specifies that the 
+     * function should also return the names of the local 
+     * groups in which the user is indirectly a member.
+     */
+    nStatus = NetUserGetLocalGroups(NULL,
+	wszUserName,
+	dwLevel,
+	dwFlags,
+	&pBufTmp,
+	dwPrefMaxLen,
+	&dwEntriesRead,
+	&dwTotalEntries);
+    pBuf = (LPLOCALGROUP_USERS_INFO_0) pBufTmp;
+    /*
+     * If the call succeeds,
+     */
+    if (nStatus == NERR_Success) {
+	if ((pTmpBuf = pBuf) != NULL) {
+	    for (i = 0; i < dwEntriesRead; i++) {
+		assert(pTmpBuf != NULL);
+		if (pTmpBuf == NULL) {
+		    result = 0;
+		    break;
+		}
+		if (wcstrcmparray(pTmpBuf->lgrui0_name, Groups) == 0) {
+		    result = 1;
+		    break;
+		}
+		pTmpBuf++;
+		dwTotalCount++;
+	    }
+	}
+    } else
+	result = 0;
+/*
+ * Free the allocated memory.
+ */
+    if (pBuf != NULL)
+	NetApiBufferFree(pBuf);
+    return result;
+}
+
+
+/* returns 1 on success, 0 on failure */
+int
+Valid_Global_Groups(char *UserName, const char **Groups)
+{
+    int result = 0;
+    WCHAR wszUserName[UNLEN + 1];	// Unicode user name
+
+    WCHAR wszDomainControllerName[UNCLEN + 1];
+
+    char NTDomain[DNLEN + UNLEN + 2];
+    char *domain_qualify = NULL;
+    char User[UNLEN + 1];
+    size_t j;
+
+    LPGROUP_USERS_INFO_0 pUsrBuf = NULL;
+    LPGROUP_USERS_INFO_0 pTmpBuf;
+    PDOMAIN_CONTROLLER_INFO pDCInfo = NULL;
+    DWORD dwLevel = 0;
+    DWORD dwPrefMaxLen = -1;
+    DWORD dwEntriesRead = 0;
+    DWORD dwTotalEntries = 0;
+    NET_API_STATUS nStatus;
+    DWORD i;
+    DWORD dwTotalCount = 0;
+    LPBYTE pBufTmp = NULL;
+
+    strncpy(NTDomain, UserName, sizeof(NTDomain));
+
+    for (j = 0; j < strlen(NTV_VALID_DOMAIN_SEPARATOR); j++) {
+	if ((domain_qualify = strchr(NTDomain, NTV_VALID_DOMAIN_SEPARATOR[j])) != NULL)
+	    break;
+    }
+    if (domain_qualify == NULL) {
+	strcpy(User, NTDomain);
+	strcpy(NTDomain, DefaultDomain);
+    } else {
+	strcpy(User, domain_qualify + 1);
+	domain_qualify[0] = '\0';
+	strlwr(NTDomain);
+    }
+
+    debug("Valid_Global_Groups: checking group membership of '%s\\%s'.\n", NTDomain, User);
+
+    /* Convert ANSI User Name to Unicode */
+
+    MultiByteToWideChar(CP_ACP, 0, User,
+	strlen(User) + 1, wszUserName,
+	sizeof(wszUserName) / sizeof(wszUserName[0]));
+
+    /* Query AD for a DC */
+
+    if (DsGetDcName(NULL, NTDomain, NULL, NULL, DS_IS_FLAT_NAME | DS_RETURN_FLAT_NAME, &pDCInfo) != NO_ERROR) {
+	fprintf(stderr, "%s DsGetDcName() failed.'\n", myname);
+	if (pDCInfo != NULL)
+	    NetApiBufferFree(pDCInfo);
+	return result;
+    }
+    /* Convert ANSI Domain Controller Name to Unicode */
+
+    MultiByteToWideChar(CP_ACP, 0, pDCInfo->DomainControllerName,
+	strlen(pDCInfo->DomainControllerName) + 1, wszDomainControllerName,
+	sizeof(wszDomainControllerName) / sizeof(wszDomainControllerName[0]));
+
+    debug("Using '%S' as DC for '%s' user's domain.\n", wszDomainControllerName, NTDomain);
+    debug("DC Active Directory Site is %s\n", pDCInfo->DcSiteName);
+    debug("Machine Active Directory Site is %s\n", pDCInfo->ClientSiteName);
+
+    /*
+     * Call the NetUserGetGroups function 
+     * specifying information level 0.
+     */
+    dwLevel = 0;
+    pBufTmp = NULL;
+    nStatus = NetUserGetGroups(wszDomainControllerName,
+	wszUserName,
+	dwLevel,
+	&pBufTmp,
+	dwPrefMaxLen,
+	&dwEntriesRead,
+	&dwTotalEntries);
+    pUsrBuf = (LPGROUP_USERS_INFO_0) pBufTmp;
+    /*
+     * If the call succeeds,
+     */
+    if (nStatus == NERR_Success) {
+	if ((pTmpBuf = pUsrBuf) != NULL) {
+	    for (i = 0; i < dwEntriesRead; i++) {
+		assert(pTmpBuf != NULL);
+		if (pTmpBuf == NULL) {
+		    result = 0;
+		    break;
+		}
+		if (wcstrcmparray(pTmpBuf->grui0_name, Groups) == 0) {
+		    result = 1;
+		    break;
+		}
+		pTmpBuf++;
+		dwTotalCount++;
+	    }
+	}
+    } else {
+	result = 0;
+	fprintf(stderr, "%s NetUserGetGroups() failed.'\n", myname);
+    }
+    /*
+     * Free the allocated memory.
+     */
+    if (pUsrBuf != NULL)
+	NetApiBufferFree(pUsrBuf);
+    if (pDCInfo != NULL)
+	NetApiBufferFree((LPVOID) pDCInfo);
+    return result;
+}
+
+static void
+usage(char *program)
+{
+    fprintf(stderr, "Usage: %s [-D domain][-G][-P][-c][-d][-h]\n"
+	" -D    default user Domain\n"
+	" -G    enable Domain Global group mode\n"
+	" -c    use case insensitive compare\n"
+	" -d    enable debugging\n"
+	" -h    this message\n",
+	program);
+}
+
+void
+process_options(int argc, char *argv[])
+{
+    int opt;
+
+    opterr = 0;
+    while (-1 != (opt = getopt(argc, argv, "D:Gcdh"))) {
+	switch (opt) {
+	case 'D':
+	    DefaultDomain = xstrndup(optarg, DNLEN + 1);
+	    strlwr(DefaultDomain);
+	    break;
+	case 'G':
+	    use_global = 1;
+	    break;
+	case 'c':
+	    use_case_insensitive_compare = 1;
+	    break;
+	case 'd':
+	    debug_enabled = 1;
+	    break;
+	case 'h':
+	    usage(argv[0]);
+	    exit(0);
+	case '?':
+	    opt = optopt;
+	    /* fall thru to default */
+	default:
+	    fprintf(stderr, "%s Unknown option: -%c. Exiting\n", myname, opt);
+	    usage(argv[0]);
+	    exit(1);
+	    break;		/* not reached */
+	}
+    }
+    return;
+}
+
+
+int
+main(int argc, char *argv[])
+{
+    char *p;
+    char buf[BUFSIZE];
+    char *username;
+    char *group;
+    int err = 0;
+    const char *groups[512];
+    int n;
+
+    if (argc > 0) {		/* should always be true */
+	myname = strrchr(argv[0], '/');
+	if (myname == NULL)
+	    myname = argv[0];
+    } else {
+	myname = "(unknown)";
+    }
+    mypid = getpid();
+
+    setbuf(stdout, NULL);
+    setbuf(stderr, NULL);
+
+    /* Check Command Line */
+    process_options(argc, argv);
+
+    if (use_global) {
+	if ((machinedomain = GetDomainName()) == NULL) {
+	    fprintf(stderr, "%s Can't read machine domain\n", myname);
+	    exit(1);
+	}
+	strlwr(machinedomain);
+	if (!DefaultDomain)
+	    DefaultDomain = xstrdup(machinedomain);
+    }
+    debug("External ACL win32 group helper build " __DATE__ ", " __TIME__
+	" starting up...\n");
+    if (use_global)
+	debug("Domain Global group mode enabled using '%s' as default domain.\n", DefaultDomain);
+    if (use_case_insensitive_compare)
+	debug("Warning: running in case insensitive mode !!!\n");
+
+    /* Main Loop */
+    while (fgets(buf, sizeof(buf), stdin)) {
+	if (NULL == strchr(buf, '\n')) {
+	    /* too large message received.. skip and deny */
+	    fprintf(stderr, "%s: ERROR: Too large: %s\n", argv[0], buf);
+	    while (fgets(buf, sizeof(buf), stdin)) {
+		fprintf(stderr, "%s: ERROR: Too large..: %s\n", argv[0], buf);
+		if (strchr(buf, '\n') != NULL)
+		    break;
+	    }
+	    goto error;
+	}
+	if ((p = strchr(buf, '\n')) != NULL)
+	    *p = '\0';		/* strip \n */
+	if ((p = strchr(buf, '\r')) != NULL)
+	    *p = '\0';		/* strip \r */
+
+	debug("Got '%s' from Squid (length: %d).\n", buf, strlen(buf));
+
+	if (buf[0] == '\0') {
+	    fprintf(stderr, "Invalid Request\n");
+	    goto error;
+	}
+	username = strtok(buf, " ");
+	for (n = 0; (group = strtok(NULL, " ")) != NULL; n++) {
+	    rfc1738_unescape(group);
+	    groups[n] = group;
+	}
+	groups[n] = NULL;
+
+	if (NULL == username) {
+	    fprintf(stderr, "Invalid Request\n");
+	    goto error;
+	}
+	rfc1738_unescape(username);
+
+	if ((use_global ? Valid_Global_Groups(username, groups) : Valid_Local_Groups(username, groups))) {
+	    printf("OK\n");
+	} else {
+	  error:
+	    printf("ERR\n");
+	}
+	err = 0;
+    }
+    return 0;
+}
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.h squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.h
--- squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.h	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.h	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,79 @@
+/*
+ * (C) 2002, 2005 Guido Serassio <guido.serassio@acmeconsulting.it>
+ * Based on previous work of Francesco Chemolli, Robert Collins and Andrew Doran
+ *
+ * Distributed freely under the terms of the GNU General Public License,
+ * version 2. See the file COPYING for licensing details
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ */
+
+#undef debug
+
+/************* CONFIGURATION ***************/
+/*
+ * define this if you want debugging
+ */
+#ifndef DEBUG
+#define DEBUG
+#endif
+
+/************* END CONFIGURATION ***************/
+
+#include <sys/types.h>
+
+#define safe_free(x)	if (x) { free(x); x = NULL; }
+
+/* Debugging stuff */
+
+#ifdef __GNUC__			/* this is really a gcc-ism */
+#ifdef DEBUG
+#include <stdio.h>
+#include <unistd.h>
+static char *__foo;
+extern char debug_enabled;
+#define debug(X...) if (debug_enabled) { \
+                    fprintf(stderr,"%s[%d](%s:%d): ", myname, mypid, \
+                    ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
+                    __LINE__);\
+                    fprintf(stderr,X); }
+#else /* DEBUG */
+#define debug(X...)		/* */
+#endif /* DEBUG */
+#else /* __GNUC__ */
+extern char debug_enabled;
+static void
+debug(char *format,...)
+{
+#ifdef DEBUG
+#ifdef _SQUID_MSWIN_
+    if (debug_enabled) {
+	va_list args;
+
+	va_start(args, format);
+	fprintf(stderr, "%s[%d]: ", myname, mypid);
+	vfprintf(stderr, format, args);
+	fprintf(stderr, "\n");
+	va_end(args);
+    }
+#endif /* _SQUID_MSWIN_ */
+#endif /* DEBUG */
+}
+#endif /* __GNUC__ */
+
+
+/* A couple of harmless helper macros */
+#define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
+#ifdef __GNUC__
+#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
+#else
+/* no gcc, no debugging. varargs macros are a gcc extension */
+#define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
+#endif
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/readme.txt squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/readme.txt
--- squid-3.0.STABLE5/helpers/external_acl/mswin_ad_group/readme.txt	1970-01-01 12:00:00.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_ad_group/readme.txt	2008-05-21 03:01:11.000000000 +1200
@@ -0,0 +1,83 @@
+
+This is the readme.txt file for mswin_check_ad_group, an external
+helper for the External ACL Scheme for Squid.
+
+
+This helper must be used in with an authentication scheme (tipically 
+basic, NTLM or Negotiate) based on Windows Active Directory domain users. 
+It reads from the standard input the domain username and a list of groups
+and tries to match it against the groups membership of the specified
+username.
+
+The minimal Windows version needed to run mswin_check_ad_group is
+a Windows 2000 SP4 member of an Active Directory Domain.
+
+==============
+Program Syntax
+==============
+
+mswin_check_lm_group [-D domain][-G][-c][-d][-h]
+
+-D domain specify the default user's domain
+-G        start helper in Domain Global Group mode
+-c        use case insensitive compare
+-d        enable debugging
+-h        this message
+
+
+================
+squid.conf usage
+================
+
+external_acl_type AD_global_group %LOGIN c:/squid/libexec/mswin_check_ad_group.exe -G
+external_acl_type NT_local_group %LOGIN c:/squid/libexec/mswin_check_ad_group.exe
+
+acl GProxyUsers external AD_global_group GProxyUsers
+acl LProxyUsers external NT_local_group LProxyUsers
+acl password proxy_auth REQUIRED
+
+http_access allow password GProxyUsers
+http_access allow password LProxyUsers
+http_access deny all
+
+In the previous example all validated AD users member of GProxyUsers Global 
+domain group or member of LProxyUsers machine local group are allowed to 
+use the cache.
+
+Groups with spaces in name, for example "Domain Users", must be quoted and
+the acl data ("Domain Users") must be placed into a separate file included
+by specifying "/path/to/file". The previous example will be:
+
+acl ProxyUsers external NT_global_group "c:/squid/etc/DomainUsers"
+
+and the DomainUsers files will contain only the following line:
+
+"Domain Users"
+
+NOTES: 
+- The standard group name comparison is case sensitive, so group name
+  must be specified with same case as in the Active Directory Domain.
+  It's possible to enable case insensitive group name comparison (-c),
+  but on some not-english locales, the results can be unexpected.
+- Native WIN32 NTLM and Basic Helpers must be used without the
+  -A & -D switches.
+
+Refer to Squid documentation for the more details on squid.conf.
+
+
+=======
+Testing
+=======
+
+I strongly reccomend that mswin_check_ad_group is tested prior to being used in a 
+production environment. It may behave differently on different platforms.
+To test it, run it from the command line. Enter username and group
+pairs separated by a space (username must entered with domain%5cusername
+syntax). Press ENTER to get an OK or ERR message.
+Make sure pressing <CTRL><D> behaves the same as a carriage return.
+Make sure pressing <CTRL><C> aborts the program.
+
+Test that entering no details does not result in an OK or ERR message.
+Test that entering an invalid username and group results in an ERR message.
+Test that entering an valid username and group results in an OK message.
+
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/mswin_lm_group/readme.txt squid-3.0.STABLE6/helpers/external_acl/mswin_lm_group/readme.txt
--- squid-3.0.STABLE5/helpers/external_acl/mswin_lm_group/readme.txt	2008-04-29 15:43:27.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/mswin_lm_group/readme.txt	2008-05-21 03:01:11.000000000 +1200
@@ -1,10 +1,10 @@
 
 This is the readme.txt file for mswin_check_lm_group, an external
-helper fo the External ACL Scheme for Squid.
+helper for the External ACL Scheme for Squid.
 
 
-This helper must be used in with an authentication scheme, tipically 
-basic or NTLM, based on Windows NT/2000 domain users. 
+This helper must be used in with an authentication scheme (tipically 
+basic or NTLM) based on Windows NT/2000 domain users (LM mode). 
 It reads from the standard input the domain username and a list of groups
 and tries to match it against the groups membership of the specified
 username.
@@ -54,10 +54,10 @@
 "Domain Users"
 
 NOTES: 
-- The standard group name comparation is case sensitive, so group name
+- The standard group name comparison is case sensitive, so group name
   must be specified with same case as in the NT/2000 Domain.
-  It's possible to enable not case sensitive group name comparation (-c),
-  but on on some non - English locales, the results can be unexpected.
+  It's possible to enable case insensitive group name comparison (-c),
+  but on some not-english locales, the results can be unexpected.
 - Native WIN32 NTLM and Basic Helpers must be used without the
   -A & -D switches.
 
@@ -71,7 +71,7 @@
 I strongly reccomend that mswin_check_lm_group is tested prior to being used in a 
 production environment. It may behave differently on different platforms.
 To test it, run it from the command line. Enter username and group
-pairs separated by a space (username must entered with domain\\username
+pairs separated by a space (username must entered with domain%5cusername
 syntax). Press ENTER to get an OK or ERR message.
 Make sure pressing <CTRL><D> behaves the same as a carriage return.
 Make sure pressing <CTRL><C> aborts the program.
diff -u -r -N squid-3.0.STABLE5/helpers/external_acl/session/squid_session.c squid-3.0.STABLE6/helpers/external_acl/session/squid_session.c
--- squid-3.0.STABLE5/helpers/external_acl/session/squid_session.c	2008-04-29 15:43:28.000000000 +1200
+++ squid-3.0.STABLE6/helpers/external_acl/session/squid_session.c	2008-05-21 03:01:11.000000000 +1200
@@ -27,9 +27,14 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <string.h>
 #include <time.h>
+#if HAVE_GETOPT_H
+#include <getopt.h>
+#endif
 
 #if defined(HAVE_DB_185_H)
 #include <db_185.h>
diff -u -r -N squid-3.0.STABLE5/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c squid-3.0.STABLE6/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c
--- squid-3.0.STABLE5/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c	2008-04-29 15:43:28.000000000 +1200
+++ squid-3.0.STABLE6/helpers/ntlm_auth/SMB/smbval/rfcnb-util.c	2008-05-21 03:01:11.000000000 +1200
@@ -340,7 +340,7 @@
 	    return (RFCNBE_Bad);
 
 	} else { /* We got a name */
-	    Dest_IP->s_addr = ((struct sockaddr_in*)hp->h_addr_list[0])->sin_addr.s_addr;
+	    Dest_IP->s_addr = (*((struct in_addr*)hp->h_addr_list[0])).s_addr;
 	}
     } else { /* It was an IP address */
 	Dest_IP->s_addr = addr;
diff -u -r -N squid-3.0.STABLE5/include/autoconf.h.in squid-3.0.STABLE6/include/autoconf.h.in
--- squid-3.0.STABLE5/include/autoconf.h.in	2008-04-29 15:43:28.000000000 +1200
+++ squid-3.0.STABLE6/include/autoconf.h.in	2008-05-21 03:01:12.000000000 +1200
@@ -363,6 +363,12 @@
 /* Define to 1 if you have the <netinet/ip_fil.h> header file. */
 #undef HAVE_NETINET_IP_FIL_H
 
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#undef HAVE_NETINET_IP_H
+
+/* Define to 1 if you have the <netinet/ip_icmp.h> header file. */
+#undef HAVE_NETINET_IP_ICMP_H
+
 /* Define to 1 if you have the <netinet/ip_nat.h> header file. */
 #undef HAVE_NETINET_IP_NAT_H
 
diff -u -r -N squid-3.0.STABLE5/include/squid_types.h squid-3.0.STABLE6/include/squid_types.h
--- squid-3.0.STABLE5/include/squid_types.h	2008-04-29 15:43:28.000000000 +1200
+++ squid-3.0.STABLE6/include/squid_types.h	2008-05-21 03:01:12.000000000 +1200
@@ -73,6 +73,10 @@
 #if HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#if HAVE_NETINET_IN_SYSTM_H
+/* Several OS require types declared by in_systm.h without including it themselves. */
+#include <netinet/in_systm.h>
+#endif
 
 /* 
  * ISO C99 Standard printf() macros for 64 bit integers
diff -u -r -N squid-3.0.STABLE5/include/version.h squid-3.0.STABLE6/include/version.h
--- squid-3.0.STABLE5/include/version.h	2008-04-29 15:43:33.000000000 +1200
+++ squid-3.0.STABLE6/include/version.h	2008-05-21 03:01:16.000000000 +1200
@@ -9,5 +9,5 @@
  */
 
 #ifndef SQUID_RELEASE_TIME
-#define SQUID_RELEASE_TIME 1209440593
+#define SQUID_RELEASE_TIME 1211295657
 #endif
diff -u -r -N squid-3.0.STABLE5/lib/inet_ntoa.c squid-3.0.STABLE6/lib/inet_ntoa.c
--- squid-3.0.STABLE5/lib/inet_ntoa.c	2008-04-29 15:43:28.000000000 +1200
+++ squid-3.0.STABLE6/lib/inet_ntoa.c	2008-05-21 03:01:12.000000000 +1200
@@ -10,11 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
diff -u -r -N squid-3.0.STABLE5/lib/radix.c squid-3.0.STABLE6/lib/radix.c
--- squid-3.0.STABLE5/lib/radix.c	2008-04-29 15:43:29.000000000 +1200
+++ squid-3.0.STABLE6/lib/radix.c	2008-05-21 03:01:12.000000000 +1200
@@ -45,11 +45,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
diff -u -r -N squid-3.0.STABLE5/lib/strnstr.cc squid-3.0.STABLE6/lib/strnstr.cc
--- squid-3.0.STABLE5/lib/strnstr.cc	2008-04-29 15:43:29.000000000 +1200
+++ squid-3.0.STABLE6/lib/strnstr.cc	2008-05-21 03:01:12.000000000 +1200
@@ -37,11 +37,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
diff -u -r -N squid-3.0.STABLE5/lib/win32lib.c squid-3.0.STABLE6/lib/win32lib.c
--- squid-3.0.STABLE5/lib/win32lib.c	2008-04-29 15:43:29.000000000 +1200
+++ squid-3.0.STABLE6/lib/win32lib.c	2008-05-21 03:01:12.000000000 +1200
@@ -63,7 +63,13 @@
 size_t 
 getpagesize()
 {
-    return 4096;
+    static DWORD system_pagesize = 0;
+    if (!system_pagesize) {
+	SYSTEM_INFO system_info;
+	GetSystemInfo(&system_info);
+	system_pagesize = system_info.dwPageSize;
+    }
+    return system_pagesize;
 }
 #endif
 
diff -u -r -N squid-3.0.STABLE5/RELEASENOTES.html squid-3.0.STABLE6/RELEASENOTES.html
--- squid-3.0.STABLE5/RELEASENOTES.html	2008-04-29 15:44:23.000000000 +1200
+++ squid-3.0.STABLE6/RELEASENOTES.html	2008-05-21 03:02:08.000000000 +1200
@@ -2,10 +2,10 @@
 <HTML>
 <HEAD>
  <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
- <TITLE>Squid 3.0.STABLE4 release notes</TITLE>
+ <TITLE>Squid 3.0.STABLE6 release notes</TITLE>
 </HEAD>
 <BODY>
-<H1>Squid 3.0.STABLE4 release notes</H1>
+<H1>Squid 3.0.STABLE6 release notes</H1>
 
 <H2>Squid Developers</H2>$Id: release-3.0.sgml,v 1.30.2.5 2008/02/28 00:26:31 amosjeffries Exp $
 <HR>
@@ -15,7 +15,7 @@
 <HR>
 <H2><A NAME="s1">1. Notice</A></H2>
 
-<P>The Squid Team are pleased to announce the release of Squid-3.0.STABLE4.</P>
+<P>The Squid Team are pleased to announce the release of Squid-3.0.STABLE6.</P>
 <P>This new release is available for download from 
 <A HREF="http://www.squid-cache.org/Versions/v3/3.0/">http://www.squid-cache.org/Versions/v3/3.0/</A> or the 
 <A HREF="http://www.squid-cache.org/Mirrors/http-mirrors.html">mirrors</A>.</P>
@@ -100,7 +100,6 @@
 <LI>Mapping of server error messages. Not yet ported.</LI>
 <LI>http_access2 access directive. Not yet ported.</LI>
 <LI>Location header rewrites. Not yet ported.</LI>
-<LI>umask directive. Not yet ported.</LI>
 <LI>wais_relay. Feature dropped as it's equivalent to cache_peer + cache_peer_access.</LI>
 <LI>urlgroup. Not yet ported.</LI>
 <LI>collapsed forwarding. Not yet ported.</LI>
@@ -116,8 +115,10 @@
 <P>The TCP_REFRESH_HIT and TCP_REFRESH_MISS log types have been replaced because they were misleading (all refreshes need to query the origin server, so they could never be hits). The following log types have been introduced to replace them:</P>
 <P>
 <DL>
-<DT><B>TCP_REFRESH_UNMODIFIED</B><DD><P>The requested object was cached but STALE. The IMS query for the object resulted in "304 not modified".</P>
-<DT><B>TCP_REFRESH_MODIFIED</B><DD><P>The requested object was cached but STALE. The IMS query returned the new content.</P>
+<DT><B>TCP_REFRESH_UNMODIFIED</B><DD>
+<P>The requested object was cached but STALE. The IMS query for the object resulted in "304 not modified".</P>
+<DT><B>TCP_REFRESH_MODIFIED</B><DD>
+<P>The requested object was cached but STALE. The IMS query returned the new content.</P>
 </DL>
 </P>
 <P>See 
@@ -150,7 +151,8 @@
 
 <P>
 <DL>
-<DT><B>minimum_icp_query_timeout (msec)</B><DD><P>
+<DT><B>minimum_icp_query_timeout (msec)</B><DD>
+<P>
 <PRE>
 Default: 5
 
@@ -164,7 +166,8 @@
         
 </PRE>
 </P>
-<DT><B>background_ping_rate</B><DD><P>
+<DT><B>background_ping_rate</B><DD>
+<P>
 <PRE>
 Default: 10 seconds
 
@@ -174,7 +177,8 @@
 </PRE>
 </P>
 
-<DT><B>httpd_accel_surrogate_id</B><DD><P>
+<DT><B>httpd_accel_surrogate_id</B><DD>
+<P>
 <PRE>
 Default: unset
 
@@ -186,7 +190,8 @@
 </PRE>
 </P>
 
-<DT><B>http_accel_surrogate_remote on|off</B><DD><P>
+<DT><B>http_accel_surrogate_remote on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -196,7 +201,8 @@
 </PRE>
 </P>
 
-<DT><B>esi_parser libxml2|expat|custom</B><DD><P>
+<DT><B>esi_parser libxml2|expat|custom</B><DD>
+<P>
 <PRE>
 Default: custom
 
@@ -207,7 +213,8 @@
 </PRE>
 </P>
 
-<DT><B>email_err_data on|off</B><DD><P>
+<DT><B>email_err_data on|off</B><DD>
+<P>
 <PRE>
 Default: on
 
@@ -219,7 +226,8 @@
 </PRE>
 </P>
 
-<DT><B>refresh_all_ims on|off</B><DD><P>
+<DT><B>refresh_all_ims on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -234,10 +242,13 @@
         
 </PRE>
 </P>
-<DT><B>request_header_access</B><DD><P>Replaces the header_access directive of Squid-2.6 and earlier, but applies to requests only.</P>
-<DT><B>reply_header_access</B><DD><P>Replaces the header_access directive of Squid-2.6 and earlier, but applies to replies only.</P>
+<DT><B>request_header_access</B><DD>
+<P>Replaces the header_access directive of Squid-2.6 and earlier, but applies to requests only.</P>
+<DT><B>reply_header_access</B><DD>
+<P>Replaces the header_access directive of Squid-2.6 and earlier, but applies to replies only.</P>
 
-<DT><B>icap_enable on|off</B><DD><P>
+<DT><B>icap_enable on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -245,7 +256,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_preview_enable on|off</B><DD><P>
+<DT><B>icap_preview_enable on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -254,7 +266,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_preview_size</B><DD><P>
+<DT><B>icap_preview_size</B><DD>
+<P>
 <PRE>
 Default: -1
 
@@ -264,7 +277,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_default_options_ttl (seconds)</B><DD><P>
+<DT><B>icap_default_options_ttl (seconds)</B><DD>
+<P>
 <PRE>
 Default: 60
 
@@ -273,7 +287,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_persistent_connections on|off</B><DD><P>
+<DT><B>icap_persistent_connections on|off</B><DD>
+<P>
 <PRE>
 Default: on
 
@@ -282,7 +297,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_send_client_ip on|off</B><DD><P>
+<DT><B>icap_send_client_ip on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -290,7 +306,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_send_client_username on|off</B><DD><P>
+<DT><B>icap_send_client_username on|off</B><DD>
+<P>
 <PRE>
 Default: off
 
@@ -299,7 +316,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_service</B><DD><P>
+<DT><B>icap_service</B><DD>
+<P>
 <PRE>
 Default: none
 
@@ -323,7 +341,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_class</B><DD><P>
+<DT><B>icap_class</B><DD>
+<P>
 <PRE>
 Default: none
 
@@ -338,7 +357,8 @@
         
 </PRE>
 </P>
-<DT><B>icap_access</B><DD><P>
+<DT><B>icap_access</B><DD>
+<P>
 <PRE>
 Default: none
 
@@ -362,7 +382,8 @@
 </PRE>
 </P>
 
-<DT><B>accept_filter</B><DD><P>
+<DT><B>accept_filter</B><DD>
+<P>
 <PRE>
 The name of an accept(2) filter to install on Squid's
 listen socket(s).  This feature is perhaps specific to
@@ -375,7 +396,8 @@
 </PRE>
 </P>
 
-<DT><B>include</B><DD><P>New option to import entire secondary configuration files into squid.conf.
+<DT><B>include</B><DD>
+<P>New option to import entire secondary configuration files into squid.conf.
 <PRE>
         Squid will follow the files immediately and insert all their content
         as if it was at that position in squid.conf. As per squid.conf some
@@ -390,13 +412,26 @@
 </PRE>
 </P>
 
-<DT><B>acl myportname</B><DD><P>New acl type myportname, matching the name of the http(s)_port where the request was accepted
+<DT><B>acl myportname</B><DD>
+<P>New acl type myportname, matching the name of the http(s)_port where the request was accepted
 <PRE>
         acl aclname myportname 3128 ...         # http(s)_port name
         
 </PRE>
 </P>
 
+<DT><B>umask</B><DD>
+<P>Ported from 2.6. Behaviour identical.
+<PRE>
+        Minimum umask which should be enforced while the proxy
+        is running, in addition to the umask set at startup.
+
+        For a traditional octal representation of umasks, start
+        your value with 0.
+        
+</PRE>
+</P>
+
 </DL>
 </P>
 
@@ -405,7 +440,8 @@
 
 <P>
 <DL>
-<DT><B>http_port</B><DD><P>New options:
+<DT><B>http_port</B><DD>
+<P>New options:
 <PRE>
     disable-pmtu-discovery=
       Control Path-MTU discovery usage:
@@ -431,13 +467,15 @@
         
 </PRE>
         </P>
-<DT><B> https_port</B><DD><P>Removed options:
+<DT><B> https_port</B><DD>
+<P>Removed options:
 <PRE>
     urlgroup=, not yet ported to Squid-3.
         
 </PRE>
 </P>
-<DT><B>cache_peer</B><DD><P>New options:
+<DT><B>cache_peer</B><DD>
+<P>New options:
 <PRE>
      basetime=n
 
@@ -477,7 +515,8 @@
         
 </PRE>
 </P>
-<DT><B>cache_dir</B><DD><P>Common options
+<DT><B>cache_dir</B><DD>
+<P>Common options
 <PRE>
     no-store, replaces the older read-only option
 
@@ -500,7 +539,8 @@
         
 </PRE>
 </P>
-<DT><B>auth_param</B><DD><P>Removed Basic auth option
+<DT><B>auth_param</B><DD>
+<P>Removed Basic auth option
 <PRE>
     blankpasswor, not yet ported to squid-3.
     auth_param basic concurrency 0
@@ -514,7 +554,8 @@
 </PRE>
 </P>
 
-<DT><B>external_acl_type</B><DD><P>New format specifications:
+<DT><B>external_acl_type</B><DD>
+<P>New format specifications:
 <PRE>
     %URI          Requested URI
 
@@ -538,7 +579,8 @@
 </PRE>
 </P>
 
-<DT><B>refresh_pattern</B><DD><P>New options:
+<DT><B>refresh_pattern</B><DD>
+<P>New options:
 <PRE>
     ignore-no-store
     refresh-ims
@@ -555,7 +597,8 @@
         
 </PRE>
 </P>
-<DT><B>acl</B><DD><P>New types:
+<DT><B>acl</B><DD>
+<P>New types:
 <PRE>
     acl aclname http_status 200 301 500- 400-403 ...     # status code in reply
 
@@ -572,14 +615,16 @@
         
 </PRE>
 </P>
-<DT><B>short_icon_urls</B><DD><P>New default:
+<DT><B>short_icon_urls</B><DD>
+<P>New default:
 <PRE>
     Default: on
     (Old default: off)
         
 </PRE>
 </P>
-<DT><B>delay_class</B><DD><P>New delay classes:
+<DT><B>delay_class</B><DD>
+<P>New delay classes:
 <PRE>
     class 4 Everything in a class 3 delay pool, with an
     additional limit on a per user basis. This
@@ -593,7 +638,8 @@
 </PRE>
 </P>
 
-<DT><B>htcp_port</B><DD><P>New default to require the feature to be enabled in squid.conf:
+<DT><B>htcp_port</B><DD>
+<P>New default to require the feature to be enabled in squid.conf:
 <PRE>
     Default: 0 (disabled)
     (Old default: 4827)
@@ -601,7 +647,8 @@
 </PRE>
 </P>
 
-<DT><B>icp_port</B><DD><P>New default to require the feature to be enabled in squid.conf:
+<DT><B>icp_port</B><DD>
+<P>New default to require the feature to be enabled in squid.conf:
 <PRE>
     Default: 0 (disabled)
     (Old default: 3130)
@@ -609,7 +656,8 @@
 </PRE>
 </P>
 
-<DT><B>snmp_port</B><DD><P>New default to require the feature to be enabled in squid.conf:
+<DT><B>snmp_port</B><DD>
+<P>New default to require the feature to be enabled in squid.conf:
 <PRE>
     Default: 0 (disabled)
     (Old default: 3401)
@@ -617,7 +665,8 @@
 </PRE>
 </P>
 
-<DT><B>logformat</B><DD><P>New format tags:
+<DT><B>logformat</B><DD>
+<P>New format tags:
 <PRE>
     rp      Request URL-Path excluding hostname
 
@@ -639,7 +688,8 @@
 </PRE>
 </P>
 
-<DT><B>reply_body_max_size</B><DD><P>Syntax changed:
+<DT><B>reply_body_max_size</B><DD>
+<P>Syntax changed:
 <PRE>
     reply_body_max_size size [acl acl...]
         
@@ -647,9 +697,11 @@
 </P>
 <P>allow/deny no longer used.</P>
 
-<DT><B>url_rewrite_program</B><DD><P>No urlgroup support in either requests or responese</P>
+<DT><B>url_rewrite_program</B><DD>
+<P>No urlgroup support in either requests or responese</P>
 
-<DT><B>auth_param</B><DD><P>fake_auth helper for NTLM now accepts the '-S' parameter to strip NTLM domain off the username string.
+<DT><B>auth_param</B><DD>
+<P>fake_auth helper for NTLM now accepts the '-S' parameter to strip NTLM domain off the username string.
 This is useful for class 4 Delay Pools in Squid 3.x</P>
 
 </DL>
@@ -662,19 +714,30 @@
 
 <P>
 <DL>
-<DT><B>broken_vary_encoding</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>cache_vary</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>collapsed_forwarding</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>follow_x_forwarded_for</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>*_uses_indirect_client</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>error_map</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>header_access</B><DD><P>This has been replaced by request_header_access and reply_header_access</P>
-<DT><B>http_access2</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>httpd_accel_no_pmtu_disc</B><DD><P>Replaced by disable-pmtu-discovery http_port option</P>
-<DT><B>location_rewrite_*</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>refresh_stale_hit</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>umask</B><DD><P>Not yet ported to Squid-3.</P>
-<DT><B>wais_relay_*</B><DD><P>equivalent to cache_peer + cache_peer_access.</P>
+<DT><B>broken_vary_encoding</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>cache_vary</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>collapsed_forwarding</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>follow_x_forwarded_for</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>*_uses_indirect_client</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>error_map</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>header_access</B><DD>
+<P>This has been replaced by request_header_access and reply_header_access</P>
+<DT><B>http_access2</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>httpd_accel_no_pmtu_disc</B><DD>
+<P>Replaced by disable-pmtu-discovery http_port option</P>
+<DT><B>location_rewrite_*</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>refresh_stale_hit</B><DD>
+<P>Not yet ported to Squid-3.</P>
+<DT><B>wais_relay_*</B><DD>
+<P>equivalent to cache_peer + cache_peer_access.</P>
 </DL>
 </P>
 
@@ -703,27 +766,33 @@
 
 <P>
 <DL>
-<DT><B>--enable-shared[=PKGS]</B><DD><P>Build shared libraries. The default is to build without.</P>
+<DT><B>--enable-shared[=PKGS]</B><DD>
+<P>Build shared libraries. The default is to build without.</P>
 
-<DT><B>--enable-static[=PKGS]</B><DD><P>Build static libraries. The default is on.</P>
+<DT><B>--enable-static[=PKGS]</B><DD>
+<P>Build static libraries. The default is on.</P>
 
-<DT><B>--enable-fast-install[=PKGS]</B><DD><P>
+<DT><B>--enable-fast-install[=PKGS]</B><DD>
+<P>
 <PRE>
 Optimize for fast installation
         default: yes
 </PRE>
 </P>
 
-<DT><B>--disable-libtool-lock</B><DD><P>Avoid locking (might break parallel builds)</P>
+<DT><B>--disable-libtool-lock</B><DD>
+<P>Avoid locking (might break parallel builds)</P>
 
-<DT><B>--disable-optimizations</B><DD><P>Don't compile Squid with compiler optimizations enabled.
+<DT><B>--disable-optimizations</B><DD>
+<P>Don't compile Squid with compiler optimizations enabled.
 Optimization is good for production builds, but not
 good for debugging. During development, use
 --disable-optimizations to reduce compilation times
 and allow easier debugging. This option implicitly
 also enables --disable-inline</P>
 
-<DT><B>--disable-inline</B><DD><P>Don't compile trivial methods as inline. Squid
+<DT><B>--disable-inline</B><DD>
+<P>Don't compile trivial methods as inline. Squid
 is coded with much of the code able to be inlined.
 Inlining is good for production builds, but not
 good for development. During development, use
@@ -733,15 +802,18 @@
 --enable-inline to have squid make all trivial
 methods inlinable by the compiler.</P>
 
-<DT><B>--enable-debug-cbdata</B><DD><P>Provide some debug information in cbdata</P>
+<DT><B>--enable-debug-cbdata</B><DD>
+<P>Provide some debug information in cbdata</P>
 
-<DT><B>--enable-disk-io=\"list of modules\"</B><DD><P>Build support for the list of disk I/O modules.
+<DT><B>--enable-disk-io=\"list of modules\"</B><DD>
+<P>Build support for the list of disk I/O modules.
 The default is only to build the "Blocking" module.
 See src/DiskIO for a list of available modules, or
 Programmers Guide for details on how to build your
 custom disk module.</P>
 
-<DT><B>--enable-esi</B><DD><P>Enable ESI for accelerators. Requires libexpat.
+<DT><B>--enable-esi</B><DD>
+<P>Enable ESI for accelerators. Requires libexpat.
 Enabling ESI will cause squid to follow the Edge
 Acceleration Specification (www.esi.org). This
 causes squid to IGNORE client Cache-Control headers.</P>
@@ -749,23 +821,30 @@
 proxy, ONLY use it in a squid configured for
 webserver acceleration.</P>
 
-<DT><B>--enable-icap-client</B><DD><P>Enable the ICAP client.</P>
+<DT><B>--enable-icap-client</B><DD>
+<P>Enable the ICAP client.</P>
 
-<DT><B>--disable-snmp</B><DD><P>Disable SNMP monitoring support which is now built by default.</P>
+<DT><B>--disable-snmp</B><DD>
+<P>Disable SNMP monitoring support which is now built by default.</P>
 
-<DT><B>--disable-htcp</B><DD><P>Disable HTCP protocol support which is now built by default.</P>
+<DT><B>--disable-htcp</B><DD>
+<P>Disable HTCP protocol support which is now built by default.</P>
 
-<DT><B>--enable-kqueue</B><DD><P>Enable kqueue() support. Marked as experimental in 3.0.</P>
+<DT><B>--enable-kqueue</B><DD>
+<P>Enable kqueue() support. Marked as experimental in 3.0.</P>
 
-<DT><B>--enable-ipfw-transparent</B><DD><P>Enable Transparent Proxy support for systems
+<DT><B>--enable-ipfw-transparent</B><DD>
+<P>Enable Transparent Proxy support for systems
 using FreeBSD IPFW style redirection.</P>
 
-<DT><B>--disable-mempools</B><DD><P>Disable memPools. Note that this option now simply sets the
+<DT><B>--disable-mempools</B><DD>
+<P>Disable memPools. Note that this option now simply sets the
 default behaviour. Specific classes can override this at runtime, and
 only lib/MemPool.c needs to be altered to change the squid-wide
 default for all classes.</P>
 
-<DT><B>--enable-cpu-profiling</B><DD><P>This option allows you to see which internal functions
+<DT><B>--enable-cpu-profiling</B><DD>
+<P>This option allows you to see which internal functions
 in Squid are consuming how much CPU. Compiles in probes
 that measure time spent in probed functions. Needs
 source modifications to add new probes. This is meant
@@ -775,16 +854,21 @@
 you shouldn't enable this, as overhead added, although
 small, is still overhead. See lib/Profiler.c for more.</P>
 
-<DT><B>--with-gnu-ld</B><DD><P>Assume the C compiler uses GNU ld. The default is to auto-detect.</P>
+<DT><B>--with-gnu-ld</B><DD>
+<P>Assume the C compiler uses GNU ld. The default is to auto-detect.</P>
 
-<DT><B>--with-pic</B><DD><P>Try to use only PIC/non-PIC objects. The default is to use both.</P>
+<DT><B>--with-pic</B><DD>
+<P>Try to use only PIC/non-PIC objects. The default is to use both.</P>
 
-<DT><B>--with-tags[=TAGS]</B><DD><P>Include additional configurations. The default is automatic.</P>
+<DT><B>--with-tags[=TAGS]</B><DD>
+<P>Include additional configurations. The default is automatic.</P>
 
-<DT><B>--with-default-user=USER</B><DD><P>Sets the default System User account for squid permissions.
+<DT><B>--with-default-user=USER</B><DD>
+<P>Sets the default System User account for squid permissions.
 The default is 'nobody' as in other releases of squid.</P>
 
-<DT><B>--with-cppunit-basedir=[PATH]</B><DD><P>Path where the cppunit headers and libraries are found
+<DT><B>--with-cppunit-basedir=[PATH]</B><DD>
+<P>Path where the cppunit headers and libraries are found
 for unit testing. The default is automatic detection.</P>
 <P>NOTE: Since 3.0-PRE6 and 2.6STABLE14 squid no longer comes
 bundled with CPPUnit. Compile-time validation will be disabled
@@ -796,33 +880,42 @@
 
 <P>
 <DL>
-<DT><B>--enable-carp</B><DD><P>CARP support is now built by default.
+<DT><B>--enable-carp</B><DD>
+<P>CARP support is now built by default.
 --disable-carp can be used to build without it.</P>
 
-<DT><B>--enable-htcp</B><DD><P>HTCP protocol support is now built by default.
+<DT><B>--enable-htcp</B><DD>
+<P>HTCP protocol support is now built by default.
 Use --disable-htcp to build without it.</P>
 
-<DT><B>--enable-snmp</B><DD><P>SNMP monitoring is now build by default.
+<DT><B>--enable-snmp</B><DD>
+<P>SNMP monitoring is now build by default.
 Use --disable-snmp to build without it.</P>
 
-<DT><B>--enable-heap-replacement</B><DD><P>Please use --enable-removal-policies directive instead.</P>
+<DT><B>--enable-heap-replacement</B><DD>
+<P>Please use --enable-removal-policies directive instead.</P>
 
-<DT><B>--with-maxfd=N</B><DD><P>Replaced by --with-filedescriptors=N</P>
+<DT><B>--with-maxfd=N</B><DD>
+<P>Replaced by --with-filedescriptors=N</P>
 <P>Override maximum number of filedescriptors. Useful
 if you build as another user who is not privileged
 to use the number of filedescriptors you want the
 resulting binary to support</P>
 
-<DT><B>--enable-select</B><DD><P>Deprecated.
+<DT><B>--enable-select</B><DD>
+<P>Deprecated.
 Automatic checks will enable best I/O loop method available.</P>
 
-<DT><B>--enable-epoll</B><DD><P>Deprecated.
+<DT><B>--enable-epoll</B><DD>
+<P>Deprecated.
 Automatic checks will enable best I/O loop method available.</P>
 
-<DT><B>--enable-poll</B><DD><P>Deprecated.
+<DT><B>--enable-poll</B><DD>
+<P>Deprecated.
 Automatic checks will enable best I/O loop method available.</P>
 
-<DT><B>--enable-kqueue</B><DD><P>kqueue support is marked Experimental in Squid 3.0. Known to have some issues under load.</P>
+<DT><B>--enable-kqueue</B><DD>
+<P>kqueue support is marked Experimental in Squid 3.0. Known to have some issues under load.</P>
 
 </DL>
 </P>
@@ -832,11 +925,14 @@
 porting one of these from Squid-2 to Squid-3 is most welcome.</P>
 <P>
 <DL>
-<DT><B>--enable-devpoll</B><DD><P>Support for Solaris /dev/poll</P>
+<DT><B>--enable-devpoll</B><DD>
+<P>Support for Solaris /dev/poll</P>
 
-<DT><B>--enable-select-simple</B><DD><P>Basic POSIX select() loop without any binary fd_set optimizations.</P>
+<DT><B>--enable-select-simple</B><DD>
+<P>Basic POSIX select() loop without any binary fd_set optimizations.</P>
 
-<DT><B>--enable-follow-x-forwarded-for</B><DD><P>Support following the X-Forwarded-For HTTP header for determining the
+<DT><B>--enable-follow-x-forwarded-for</B><DD>
+<P>Support following the X-Forwarded-For HTTP header for determining the
 client IP address</P>
 </DL>
 </P>
@@ -846,13 +942,20 @@
 <P>The following configure options have been removed.</P>
 <P>
 <DL>
-<DT><B>--enable-dlmalloc</B><DD><P>Most OS:es have good malloc implementations these days, and the version we used to ship with Squid was very very old..</P>
-<DT><B>--enable-mempool-debug</B><DD><P>Debug option, not needed and therefore removed.</P>
-<DT><B>--enable-forward-log</B><DD><P>Rarely used extra log file. Removed.</P>
-<DT><B>--enable-multicast-miss</B><DD><P>Rarely used feature, and multicast ICP acheives almost the same result. Removed.</P>
-<DT><B>--enable-coss-aio-ops</B><DD><P>Specific to the COSS implementation in Squid-2</P>
-<DT><B>--enable-large-cache-files</B><DD><P>Now enabled by default. Configure option was redundant and therefore removed.</P>
-<DT><B>--enable-truncate</B><DD><P>Known to cause race conditions where cache objects may get corrupted, and this for at most a marginal performance improvement. Removed.</P>
+<DT><B>--enable-dlmalloc</B><DD>
+<P>Most OS:es have good malloc implementations these days, and the version we used to ship with Squid was very very old..</P>
+<DT><B>--enable-mempool-debug</B><DD>
+<P>Debug option, not needed and therefore removed.</P>
+<DT><B>--enable-forward-log</B><DD>
+<P>Rarely used extra log file. Removed.</P>
+<DT><B>--enable-multicast-miss</B><DD>
+<P>Rarely used feature, and multicast ICP acheives almost the same result. Removed.</P>
+<DT><B>--enable-coss-aio-ops</B><DD>
+<P>Specific to the COSS implementation in Squid-2</P>
+<DT><B>--enable-large-cache-files</B><DD>
+<P>Now enabled by default. Configure option was redundant and therefore removed.</P>
+<DT><B>--enable-truncate</B><DD>
+<P>Known to cause race conditions where cache objects may get corrupted, and this for at most a marginal performance improvement. Removed.</P>
 
 </DL>
 </P>
diff -u -r -N squid-3.0.STABLE5/src/access_log.cc squid-3.0.STABLE6/src/access_log.cc
--- squid-3.0.STABLE5/src/access_log.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/access_log.cc	2008-05-21 03:01:14.000000000 +1200
@@ -1296,7 +1296,7 @@
         safe_free(user);
 
     if (!Config.onoff.log_mime_hdrs) {
-        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %"PRId64" %s %s %s %s%s/%s %s",
+        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %"PRId64" %s %s %s %s%s/%s %s\n",
                       (long int) current_time.tv_sec,
                       (int) current_time.tv_usec / 1000,
                       al->cache.msec,
@@ -1314,7 +1314,7 @@
     } else {
         char *ereq = log_quote(al->headers.request);
         char *erep = log_quote(al->headers.reply);
-        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %"PRId64" %s %s %s %s%s/%s %s [%s] [%s]",
+        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %"PRId64" %s %s %s %s%s/%s %s [%s] [%s]\n",
                       (long int) current_time.tv_sec,
                       (int) current_time.tv_usec / 1000,
                       al->cache.msec,
@@ -1334,7 +1334,6 @@
         safe_free(ereq);
         safe_free(erep);
     }
-    logfilePrintf(logfile, "\n");
     safe_free(user);
 }
 
diff -u -r -N squid-3.0.STABLE5/src/auth/basic/auth_basic.cc squid-3.0.STABLE6/src/auth/basic/auth_basic.cc
--- squid-3.0.STABLE5/src/auth/basic/auth_basic.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/auth/basic/auth_basic.cc	2008-05-21 03:01:14.000000000 +1200
@@ -322,9 +322,7 @@
 
 AuthBasicConfig::~AuthBasicConfig()
 {
-    if(basicAuthRealm)
-        delete basicAuthRealm;
-    basicAuthRealm = NULL;
+    safe_free(basicAuthRealm);
 }
 
 void
@@ -393,15 +391,20 @@
 bool
 BasicUser::decodeCleartext()
 {
-    char *sent_auth;
+    char *sent_auth = NULL;
+
     /* username and password */
     sent_auth = xstrdup(httpAuthHeader);
+
     /* Trim trailing \n before decoding */
     strtok(sent_auth, "\n");
 
     cleartext = uudecode(sent_auth);
 
-    xfree(sent_auth);
+    safe_free(sent_auth);
+
+    if (!cleartext)
+        return false;
 
     /*
      * Don't allow NL or CR in the credentials.
@@ -420,13 +423,19 @@
 void
 BasicUser::extractUsername()
 {
-    char * tempusername = cleartext;
-    /* terminate the username string */
+    char * seperator = strchr(cleartext, ':');
+
+    if (seperator == NULL) {
+        username(cleartext);
+    } else {
+        /* terminate the username */
+        *seperator = '\0';
 
-    if ((cleartext = strchr(tempusername, ':')) != NULL)
-        *(cleartext)++ = '\0';
+        username(cleartext);
 
-    username (tempusername);
+        /* replace the colon so we can find the password */
+        *seperator = ':';
+    }
 
     if (!basicConfig.casesensitive)
         Tolower((char *)username());
@@ -435,22 +444,22 @@
 void
 BasicUser::extractPassword()
 {
-    passwd = cleartext;
+    passwd = strchr(cleartext, ':');
 
-    if (cleartext == NULL) {
+    if (passwd == NULL) {
         debugs(29, 4, "authenticateBasicDecodeAuth: no password in proxy authorization header '" << httpAuthHeader << "'");
         passwd = NULL;
         currentRequest->setDenyMessage ("no password was present in the HTTP [proxy-]authorization header. This is most likely a browser bug");
-    } else if (*cleartext == '\0') {
-        debugs(29, 4, "authenticateBasicDecodeAuth: Disallowing empty password,user is '" << username() << "'");
-        passwd = NULL;
-        currentRequest->setDenyMessage ("Request denied because you provided an empty password. Users MUST have a password.");
+    } else {
+        ++passwd;
+        if (*passwd == '\0') {
+            debugs(29, 4, "authenticateBasicDecodeAuth: Disallowing empty password,user is '" << username() << "'");
+            passwd = NULL;
+            currentRequest->setDenyMessage ("Request denied because you provided an empty password. Users MUST have a password.");
+        } else {
+            passwd = xstrndup(passwd, USER_IDENT_SZ);
+        }
     }
-
-    if (passwd)
-        passwd = xstrndup(cleartext, USER_IDENT_SZ);
-
-    cleartext = NULL;
 }
 
 void
diff -u -r -N squid-3.0.STABLE5/src/auth/digest/auth_digest.cc squid-3.0.STABLE6/src/auth/digest/auth_digest.cc
--- squid-3.0.STABLE5/src/auth/digest/auth_digest.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/auth/digest/auth_digest.cc	2008-05-21 03:01:14.000000000 +1200
@@ -780,7 +780,7 @@
     if (!authenticate)
         return;
 
-    int stale = 1;
+    int stale = 0;
 
     if (auth_user_request) {
         AuthDigestUserRequest *digest_request;
@@ -1224,7 +1224,6 @@
 
     if (digest_request->cnonce && strlen(digest_request->nc) != 8) {
         debugs(29, 4, "authenticateDigestDecode: nonce count length invalid");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
@@ -1246,7 +1245,6 @@
     if (digest_request->qop && strcmp(digest_request->qop, QOP_AUTH) != 0) {
         /* we received a qop option we didn't send */
         debugs(29, 4, "authenticateDigestDecode: Invalid qop option received");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
@@ -1257,21 +1255,18 @@
 
     if (!digest_request->response || strlen(digest_request->response) != 32) {
         debugs(29, 4, "authenticateDigestDecode: Response length invalid");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
     /* do we have a username ? */
     if (!username || username[0] == '\0') {
         debugs(29, 4, "authenticateDigestDecode: Empty or not present username");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
     /* check that we're not being hacked / the username hasn't changed */
     if (nonce->user && strcmp(username, nonce->user->username())) {
         debugs(29, 4, "authenticateDigestDecode: Username for the nonce does not equal the username for the request");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
@@ -1279,7 +1274,6 @@
     if ((digest_request->qop && !digest_request->cnonce)
             || (!digest_request->qop && digest_request->cnonce)) {
         debugs(29, 4, "authenticateDigestDecode: qop without cnonce, or vice versa!");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
@@ -1289,7 +1283,6 @@
     else if (strcmp(digest_request->algorithm, "MD5")
              && strcmp(digest_request->algorithm, "MD5-sess")) {
         debugs(29, 4, "authenticateDigestDecode: invalid algorithm specified!");
-        delete digest_request;
         return authDigestLogUsername(username, digest_request);
     }
 
diff -u -r -N squid-3.0.STABLE5/src/AuthUser.cci squid-3.0.STABLE6/src/AuthUser.cci
--- squid-3.0.STABLE5/src/AuthUser.cci	2008-04-29 15:43:29.000000000 +1200
+++ squid-3.0.STABLE6/src/AuthUser.cci	2008-05-21 03:01:13.000000000 +1200
@@ -1,4 +1,3 @@
-
 /*
  * $Id: AuthUser.cci,v 1.3 2007/05/09 15:26:12 wessels Exp $
  *
@@ -34,6 +33,13 @@
  * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
  */
 
+/* for assert() */
+#include "assert.h"
+/* for xstrdup() */
+#include "util.h"
+/* for safe_free() */
+#include "defines.h"
+
 char const *
 AuthUser::username () const
 {
@@ -43,8 +49,12 @@
 void
 AuthUser::username(char const*aString)
 {
-    assert (!username() || !aString);
-    username_ = aString ? xstrdup(aString) : NULL;
+    if (aString) {
+        assert(!username_);
+        username_ = xstrdup(aString);
+    } else {
+        safe_free(username_);
+    }
 }
 
 void
@@ -52,9 +62,7 @@
 {
     /* lock for the request link */
 
-    lock()
-
-        ;
+    lock();
     dlink_node *node = dlinkNodeNew();
 
     dlinkAdd(request, node, &requests);
diff -u -r -N squid-3.0.STABLE5/src/cache_cf.cc squid-3.0.STABLE6/src/cache_cf.cc
--- squid-3.0.STABLE5/src/cache_cf.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/cache_cf.cc	2008-05-21 03:01:14.000000000 +1200
@@ -389,6 +389,7 @@
 
     if (!Config.chroot_dir) {
         leave_suid();
+        setUmask(Config.umask);
         _db_init(Config.Log.log, Config.debugOptions);
         enter_suid();
     }
diff -u -r -N squid-3.0.STABLE5/src/cache_manager.cc squid-3.0.STABLE6/src/cache_manager.cc
--- squid-3.0.STABLE5/src/cache_manager.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/cache_manager.cc	2008-05-21 03:01:14.000000000 +1200
@@ -63,6 +63,7 @@
 static char *cachemgrPasswdGet(cachemgr_passwd *, const char *);
 static const char *cachemgrActionProtection(const CacheManagerAction * at);
 static OBJH cachemgrShutdown;
+static OBJH cachemgrReconfigure;
 static OBJH cachemgrMenu;
 static OBJH cachemgrOfflineToggle;
 
@@ -74,6 +75,9 @@
     registerAction("shutdown",
                    "Shut Down the Squid Process",
                    cachemgrShutdown, 1, 1);
+    registerAction("reconfigure",
+                     "Reconfigure the Squid Process",
+                     cachemgrReconfigure, 1, 1);
     registerAction("offline_toggle",
                    "Toggle offline_mode setting",
                    cachemgrOfflineToggle, 1, 1);
@@ -349,6 +353,15 @@
 }
 
 static void
+cachemgrReconfigure(StoreEntry * sentry)
+{
+    debug(16, 0) ("Reconfigure by command.\n");
+    storeAppendPrintf(sentry, "Reconfiguring Squid Process ....");
+    reconfigure(SIGHUP);
+}
+
+/// \ingroup CacheManagerInternal
+static void
 cachemgrOfflineToggle(StoreEntry * sentry)
 {
     Config.onoff.offline = !Config.onoff.offline;
diff -u -r -N squid-3.0.STABLE5/src/cf.data.pre squid-3.0.STABLE6/src/cf.data.pre
--- squid-3.0.STABLE5/src/cf.data.pre	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/cf.data.pre	2008-05-21 03:01:14.000000000 +1200
@@ -3319,6 +3319,18 @@
 	A list of other DNS names your cache has.
 DOC_END
 
+NAME: umask
+TYPE: int
+LOC: Config.umask
+DEFAULT: 027
+DOC_START
+	Minimum umask which should be enforced while the proxy
+	is running, in addition to the umask set at startup.
+
+	For a traditional octal representation of umasks, start
+        your value with 0.
+DOC_END
+
 COMMENT_START
  OPTIONS FOR THE CACHE REGISTRATION SERVICE
  -----------------------------------------------------------------------------
diff -u -r -N squid-3.0.STABLE5/src/client_side_reply.cc squid-3.0.STABLE6/src/client_side_reply.cc
--- squid-3.0.STABLE5/src/client_side_reply.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/client_side_reply.cc	2008-05-21 03:01:14.000000000 +1200
@@ -1782,13 +1782,15 @@
 
     StoreIOBuffer tempBuffer;
     char *buf = next()->readBuffer.data;
-    char *body_buf = buf + reply->hdr_sz - next()->readBuffer.offset;
+    char *body_buf = buf + reply->hdr_sz;
 
     //Server side may disable ranges under some circumstances.
 
     if ((!http->request->range))
         next()->readBuffer.offset = 0;
 
+    body_buf -= next()->readBuffer.offset;
+
     if (next()->readBuffer.offset != 0) {
         if (next()->readBuffer.offset > body_size) {
             /* Can't use any of the body we received. send nothing */
diff -u -r -N squid-3.0.STABLE5/src/dns_internal.cc squid-3.0.STABLE6/src/dns_internal.cc
--- squid-3.0.STABLE5/src/dns_internal.cc	2008-04-29 15:43:31.000000000 +1200
+++ squid-3.0.STABLE6/src/dns_internal.cc	2008-05-21 03:01:15.000000000 +1200
@@ -370,7 +370,7 @@
 static void
 idnsParseWIN32SearchList(const char * Separator)
 {
-    BYTE *t;
+    char *t;
     char *token;
     HKEY hndKey;
 
@@ -380,36 +380,52 @@
         DWORD Type = 0;
         DWORD Size = 0;
         LONG Result;
+	Result =
+	    RegQueryValueEx(hndKey, "Domain", NULL, &Type, NULL,
+	    &Size);
+
+	if (Result == ERROR_SUCCESS && Size) {
+	    t = (char *) xmalloc(Size);
+	    RegQueryValueEx(hndKey, "Domain", NULL, &Type, (LPBYTE) t,
+		&Size);
+	    debugs(78, 1, "Adding domain " << token << " from Registry");
+	    idnsAddPathComponent(t);
+	    xfree(t);
+	}
         Result =
             RegQueryValueEx(hndKey, "SearchList", NULL, &Type, NULL,
                             &Size);
 
         if (Result == ERROR_SUCCESS && Size) {
-            t = (unsigned char *) xmalloc(Size);
-            RegQueryValueEx(hndKey, "SearchList", NULL, &Type, t,
+            t = (char *) xmalloc(Size);
+            RegQueryValueEx(hndKey, "SearchList", NULL, &Type, (LPBYTE) t,
                             &Size);
-            token = strtok((char *) t, Separator);
+            token = strtok(t, Separator);
 
             while (token) {
                 idnsAddPathComponent(token);
                 debugs(78, 1, "Adding domain " << token << " from Registry");
                 token = strtok(NULL, Separator);
             }
+	    xfree(t);
         }
 
         RegCloseKey(hndKey);
     }
+    if (npc == 0 && ((const char *) t = getMyHostname())) {
+	t = strchr(t, '.');
+	if (t)
+	    idnsAddPathComponent(t + 1);
+    }
 }
 
 static void
 idnsParseWIN32Registry(void)
 {
-    BYTE *t;
+    char *t;
     char *token;
     HKEY hndKey, hndKey2;
 
-    idnsFreeNameservers();
-
     switch (WIN32_OS_version) {
 
     case _WIN_OS_WINNT:
@@ -426,31 +442,33 @@
                                 &Size);
 
             if (Result == ERROR_SUCCESS && Size) {
-                t = (unsigned char *) xmalloc(Size);
+                t = (char *) xmalloc(Size);
                 RegQueryValueEx(hndKey, "DhcpNameServer", NULL, &Type, t,
                                 &Size);
-                token = strtok((char *) t, ", ");
+                token = strtok(t, ", ");
 
                 while (token) {
                     idnsAddNameserver(token);
                     debugs(78, 1, "Adding DHCP nameserver " << token << " from Registry");
                     token = strtok(NULL, ",");
                 }
+		xfree(t);
             }
 
             Result =
                 RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
 
             if (Result == ERROR_SUCCESS && Size) {
-                t = (unsigned char *) xmalloc(Size);
+                t = (char *) xmalloc(Size);
                 RegQueryValueEx(hndKey, "NameServer", NULL, &Type, t, &Size);
-                token = strtok((char *) t, ", ");
+                token = strtok(t, ", ");
 
                 while (token) {
                     debugs(78, 1, "Adding nameserver " << token << " from Registry");
                     idnsAddNameserver(token);
                     token = strtok(NULL, ", ");
                 }
+		xfree(t);
             }
 
             RegCloseKey(hndKey);
@@ -494,16 +512,17 @@
                                             &Type, NULL, &Size);
 
                         if (Result == ERROR_SUCCESS && Size) {
-                            t = (unsigned char *) xmalloc(Size);
+                            t = (char *) xmalloc(Size);
                             RegQueryValueEx(hndKey2, "DhcpNameServer", NULL,
                                             &Type, t, &Size);
-                            token = strtok((char *) t, ", ");
+                            token = strtok(t, ", ");
 
                             while (token) {
                                 debugs(78, 1, "Adding DHCP nameserver " << token << " from Registry");
                                 idnsAddNameserver(token);
                                 token = strtok(NULL, ", ");
                             }
+			    xfree(t);
                         }
 
                         Result =
@@ -511,16 +530,17 @@
                                             NULL, &Size);
 
                         if (Result == ERROR_SUCCESS && Size) {
-                            t = (unsigned char *) xmalloc(Size);
+                            t = (char *) xmalloc(Size);
                             RegQueryValueEx(hndKey2, "NameServer", NULL, &Type,
                                             t, &Size);
-                            token = strtok((char *) t, ", ");
+                            token = strtok(t, ", ");
 
                             while (token) {
                                 debugs(78, 1, "Adding nameserver " << token << " from Registry");
                                 idnsAddNameserver(token);
                                 token = strtok(NULL, ", ");
                             }
+			    xfree(t);
                         }
 
                         RegCloseKey(hndKey2);
@@ -552,15 +572,16 @@
                 RegQueryValueEx(hndKey, "NameServer", NULL, &Type, NULL, &Size);
 
             if (Result == ERROR_SUCCESS && Size) {
-                t = (unsigned char *) xmalloc(Size);
+                t = (char *) xmalloc(Size);
                 RegQueryValueEx(hndKey, "NameServer", NULL, &Type, t, &Size);
-                token = strtok((char *) t, ", ");
+                token = strtok(t, ", ");
 
                 while (token) {
                     debugs(78, 1, "Adding nameserver " << token << " from Registry");
                     idnsAddNameserver(token);
                     token = strtok(NULL, ", ");
                 }
+		xfree(t);
             }
 
             RegCloseKey(hndKey);
diff -u -r -N squid-3.0.STABLE5/src/main.cc squid-3.0.STABLE6/src/main.cc
--- squid-3.0.STABLE5/src/main.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/main.cc	2008-05-21 03:01:15.000000000 +1200
@@ -632,6 +632,7 @@
     errorClean();
     enter_suid();		/* root to read config file */
     parseConfigFile(ConfigFile, manager);
+    setUmask(Config.umask);
     Mem::Report();
     setEffectiveUser();
     _db_init(Config.Log.log, Config.debugOptions);
@@ -1068,7 +1069,7 @@
 main(int argc, char **argv)
 #endif
 {
-    mode_t oldmask;
+    int oldmask;
 #ifdef _SQUID_WIN32_
 
     int WIN32_init_err;
@@ -1211,6 +1212,7 @@
 
             return parse_err;
     }
+    setUmask(Config.umask);
     if (-1 == opt_send_signal)
         if (checkRunningPid())
             exit(1);
diff -u -r -N squid-3.0.STABLE5/src/Makefile.am squid-3.0.STABLE6/src/Makefile.am
--- squid-3.0.STABLE5/src/Makefile.am	2008-04-29 15:43:30.000000000 +1200
+++ squid-3.0.STABLE6/src/Makefile.am	2008-05-21 03:01:14.000000000 +1200
@@ -2242,6 +2242,7 @@
 	tests/testCoss.h \
 	$(SWAP_TEST_SOURCES)
 tests_testCoss_LDADD= \
+	libsquid.la \
 	$(SWAP_TEST_LDADD) \
 	@SSLLIB@
 tests_testCoss_LDFLAGS = $(LIBADD_DL)
diff -u -r -N squid-3.0.STABLE5/src/Makefile.in squid-3.0.STABLE6/src/Makefile.in
--- squid-3.0.STABLE5/src/Makefile.in	2008-04-29 15:43:30.000000000 +1200
+++ squid-3.0.STABLE6/src/Makefile.in	2008-05-21 03:01:14.000000000 +1200
@@ -3743,6 +3743,7 @@
 	$(SWAP_TEST_SOURCES)
 
 tests_testCoss_LDADD = \
+	libsquid.la \
 	$(SWAP_TEST_LDADD) \
 	@SSLLIB@
 
diff -u -r -N squid-3.0.STABLE5/src/protos.h squid-3.0.STABLE6/src/protos.h
--- squid-3.0.STABLE5/src/protos.h	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/protos.h	2008-05-21 03:01:15.000000000 +1200
@@ -663,6 +663,7 @@
 SQUIDCEXTERN int isPowTen(int);
 SQUIDCEXTERN void parseEtcHosts(void);
 SQUIDCEXTERN int getMyPort(void);
+SQUIDCEXTERN void setUmask(mode_t mask);
 
 SQUIDCEXTERN char *strwordtok(char *buf, char **t);
 SQUIDCEXTERN void strwordquote(MemBuf * mb, const char *str);
diff -u -r -N squid-3.0.STABLE5/src/structs.h squid-3.0.STABLE6/src/structs.h
--- squid-3.0.STABLE5/src/structs.h	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/structs.h	2008-05-21 03:01:16.000000000 +1200
@@ -740,6 +740,7 @@
 #endif
 
     char *accept_filter;
+    int umask;
 };
 
 struct _SquidConfig2
diff -u -r -N squid-3.0.STABLE5/src/tests/testCacheManager.cc squid-3.0.STABLE6/src/tests/testCacheManager.cc
--- squid-3.0.STABLE5/src/tests/testCacheManager.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/testCacheManager.cc	2008-05-21 03:01:16.000000000 +1200
@@ -13,6 +13,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
diff -u -r -N squid-3.0.STABLE5/src/tests/testEvent.cc squid-3.0.STABLE6/src/tests/testEvent.cc
--- squid-3.0.STABLE5/src/tests/testEvent.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/testEvent.cc	2008-05-21 03:01:16.000000000 +1200
@@ -15,6 +15,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init legacy static-initialized modules */
diff -u -r -N squid-3.0.STABLE5/src/tests/testEventLoop.cc squid-3.0.STABLE6/src/tests/testEventLoop.cc
--- squid-3.0.STABLE5/src/tests/testEventLoop.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/testEventLoop.cc	2008-05-21 03:01:16.000000000 +1200
@@ -16,6 +16,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init legacy static-initialized modules */
diff -u -r -N squid-3.0.STABLE5/src/tests/test_http_range.cc squid-3.0.STABLE6/src/tests/test_http_range.cc
--- squid-3.0.STABLE5/src/tests/test_http_range.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/test_http_range.cc	2008-05-21 03:01:16.000000000 +1200
@@ -45,6 +45,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 SQUIDCEXTERN void httpHeaderPutStr(HttpHeader * hdr, http_hdr_type type, const char *str)
 {
     fatal ("dummy function\n");
diff -u -r -N squid-3.0.STABLE5/src/tests/testHttpRequest.cc squid-3.0.STABLE6/src/tests/testHttpRequest.cc
--- squid-3.0.STABLE5/src/tests/testHttpRequest.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/testHttpRequest.cc	2008-05-21 03:01:16.000000000 +1200
@@ -13,6 +13,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
diff -u -r -N squid-3.0.STABLE5/src/tests/testURL.cc squid-3.0.STABLE6/src/tests/testURL.cc
--- squid-3.0.STABLE5/src/tests/testURL.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tests/testURL.cc	2008-05-21 03:01:16.000000000 +1200
@@ -14,6 +14,10 @@
 shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 /* end stubs */
 
 /* init memory pools */
diff -u -r -N squid-3.0.STABLE5/src/tools.cc squid-3.0.STABLE6/src/tools.cc
--- squid-3.0.STABLE5/src/tools.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tools.cc	2008-05-21 03:01:16.000000000 +1200
@@ -1272,6 +1272,17 @@
     return 0;			/* NOT REACHED */
 }
 
+/*
+ * Set the umask to at least the given mask. This is in addition
+ * to the umask set at startup
+ */
+void
+setUmask(mode_t mask)
+{
+    // No way to get the current umask value without setting it.
+    static const mode_t orig_umask = umask(mask); // once, to get
+    umask(mask | orig_umask); // always, to set
+}
 
 /*
  * Inverse of strwordtok. Quotes a word if needed
diff -u -r -N squid-3.0.STABLE5/src/tunnel.cc squid-3.0.STABLE6/src/tunnel.cc
--- squid-3.0.STABLE5/src/tunnel.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/tunnel.cc	2008-05-21 03:01:16.000000000 +1200
@@ -465,16 +465,18 @@
     HttpRequest *request = tunnelState->request;
     ErrorState *err = NULL;
 
-    if (tunnelState->servers->_peer)
-        hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
-                      tunnelState->servers->_peer->host);
-    else if (Config.onoff.log_ip_on_direct)
-        hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
-                      fd_table[tunnelState->server.fd()].ipaddr);
-    else
-        hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
-                      tunnelState->host);
-
+    if (tunnelState->servers) {
+        if (tunnelState->servers->_peer)
+            hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
+                          tunnelState->servers->_peer->host);
+        else if (Config.onoff.log_ip_on_direct)
+            hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
+                          fd_table[tunnelState->server.fd()].ipaddr);
+        else
+            hierarchyNote(&tunnelState->request->hier, tunnelState->servers->code,
+                          tunnelState->host);
+    } else
+       debugs(26, 1, "tunnelConnectTimeout(): tunnelState->servers is NULL");
 
     err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
 
diff -u -r -N squid-3.0.STABLE5/src/ufsdump.cc squid-3.0.STABLE6/src/ufsdump.cc
--- squid-3.0.STABLE5/src/ufsdump.cc	2008-04-29 15:43:32.000000000 +1200
+++ squid-3.0.STABLE6/src/ufsdump.cc	2008-05-21 03:01:16.000000000 +1200
@@ -48,6 +48,10 @@
 void shut_down(int)
 {}
 
+void
+reconfigure(int)
+{}
+
 #if WHENITMINIMAL
 void
 eventAdd(const char *name, EVH * func, void *arg, double when, int, bool cbdata)
diff -u -r -N squid-3.0.STABLE5/tools/Makefile.am squid-3.0.STABLE6/tools/Makefile.am
--- squid-3.0.STABLE5/tools/Makefile.am	2008-04-29 15:43:33.000000000 +1200
+++ squid-3.0.STABLE6/tools/Makefile.am	2008-05-21 03:01:16.000000000 +1200
@@ -25,7 +25,7 @@
 
 squidclient_SOURCES = squidclient.cc
 cachemgr__CGIEXT__SOURCES = cachemgr.cc
-cachemgr__CGIEXT__CFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CFLAGS)
+cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)
 
 LDADD = -L../lib -lmiscutil $(XTRA_LIBS)
 
@@ -37,6 +37,7 @@
 $(OBJS): $(top_srcdir)/include/version.h ../include/autoconf.h
 
 install-data-local:
+	$(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG).default
 	@if test -f $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG) ; then \
 	        echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)" ; \
 	else \
diff -u -r -N squid-3.0.STABLE5/tools/Makefile.in squid-3.0.STABLE6/tools/Makefile.in
--- squid-3.0.STABLE5/tools/Makefile.in	2008-04-29 15:43:33.000000000 +1200
+++ squid-3.0.STABLE6/tools/Makefile.in	2008-05-21 03:01:16.000000000 +1200
@@ -61,7 +61,7 @@
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS)
-am_cachemgr__CGIEXT__OBJECTS = cachemgr.$(OBJEXT)
+am_cachemgr__CGIEXT__OBJECTS = cachemgr__CGIEXT_-cachemgr.$(OBJEXT)
 cachemgr__CGIEXT__OBJECTS = $(am_cachemgr__CGIEXT__OBJECTS)
 cachemgr__CGIEXT__LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
@@ -318,7 +318,7 @@
 SUBDIRS = 
 squidclient_SOURCES = squidclient.cc
 cachemgr__CGIEXT__SOURCES = cachemgr.cc
-cachemgr__CGIEXT__CFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CFLAGS)
+cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS)
 LDADD = -L../lib -lmiscutil $(XTRA_LIBS)
 EXTRA_DIST = \
 	cachemgr.conf
@@ -440,7 +440,7 @@
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cachemgr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/squidclient.Po@am__quote@
 
 .cc.o:
@@ -467,6 +467,20 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
 
+cachemgr__CGIEXT_-cachemgr.o: cachemgr.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CXXFLAGS) $(CXXFLAGS) -MT cachemgr__CGIEXT_-cachemgr.o -MD -MP -MF "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo" -c -o cachemgr__CGIEXT_-cachemgr.o `test -f 'cachemgr.cc' || echo '$(srcdir)/'`cachemgr.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo" "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po"; else rm -f "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='cachemgr.cc' object='cachemgr__CGIEXT_-cachemgr.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CXXFLAGS) $(CXXFLAGS) -c -o cachemgr__CGIEXT_-cachemgr.o `test -f 'cachemgr.cc' || echo '$(srcdir)/'`cachemgr.cc
+
+cachemgr__CGIEXT_-cachemgr.obj: cachemgr.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CXXFLAGS) $(CXXFLAGS) -MT cachemgr__CGIEXT_-cachemgr.obj -MD -MP -MF "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo" -c -o cachemgr__CGIEXT_-cachemgr.obj `if test -f 'cachemgr.cc'; then $(CYGPATH_W) 'cachemgr.cc'; else $(CYGPATH_W) '$(srcdir)/cachemgr.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo" "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Po"; else rm -f "$(DEPDIR)/cachemgr__CGIEXT_-cachemgr.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='cachemgr.cc' object='cachemgr__CGIEXT_-cachemgr.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cachemgr__CGIEXT__CXXFLAGS) $(CXXFLAGS) -c -o cachemgr__CGIEXT_-cachemgr.obj `if test -f 'cachemgr.cc'; then $(CYGPATH_W) 'cachemgr.cc'; else $(CYGPATH_W) '$(srcdir)/cachemgr.cc'; fi`
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
@@ -835,6 +849,7 @@
 $(OBJS): $(top_srcdir)/include/version.h ../include/autoconf.h
 
 install-data-local:
+	$(INSTALL_DATA) $(srcdir)/cachemgr.conf $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG).default
 	@if test -f $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG) ; then \
 	        echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)" ; \
 	else \
