--------------------- PatchSet 1673 Date: 2001/02/28 05:24:02 Author: rvenning Branch: ipv6 Tag: (none) Log: One step further along the road to having IPv6 merged with head... Members: configure.in:1.5.2.1->1.5.2.2 src/access_log.c:1.5.2.2->1.5.2.3 src/acl.c:1.4.6.2->1.4.6.3 src/authenticate.c:1.4.6.1->1.4.6.2 src/cache_cf.c:1.4.2.3->1.4.2.4 src/client_side.c:1.7.2.2->1.7.2.3 src/ipcache.c:1.4.6.3->1.4.6.4 src/neighbors.c:1.5.4.2->1.5.4.3 src/protos.h:1.5.2.2->1.5.2.3 src/tools.c:1.4.2.3->1.4.2.4 src/whois.c:1.3->1.3.6.1 Index: squid/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid/configure.in,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -r1.5.2.1 -r1.5.2.2 --- squid/configure.in 7 Dec 2000 13:58:09 -0000 1.5.2.1 +++ squid/configure.in 28 Feb 2001 05:24:02 -0000 1.5.2.2 @@ -3,13 +3,13 @@ dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.5.2.1 2000/12/07 13:58:09 rvenning Exp $ +dnl $Id: configure.in,v 1.5.2.2 2001/02/28 05:24:02 rvenning Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.5.2.1 $)dnl +AC_REVISION($Revision: 1.5.2.2 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(cfgaux) @@ -22,9 +22,8 @@ dnl use directory structure of cached as default (hack) if test "$libexecdir" = '${exec_prefix}/libexec' && test "$localstatedir" = '${prefix}/var'; then - libexecdir='${bindir}' + libexecdir='${prefix}/libexec/squid' localstatedir='${prefix}' - fi dnl use .exe suffix for executables on cygwin32 platform @@ -320,9 +319,9 @@ ]) echo "Store modules built: $STORE_MODULES" AC_SUBST(STORE_MODULES) -STORE_OBJS="fs/`echo $STORE_MODULES|sed -e's% %.a fs/%g'`.a" +STORE_OBJS="fs/`echo $STORE_MODULES|sed -e 's% %.a fs/%g'`.a" AC_SUBST(STORE_OBJS) -STORE_LIBS="`echo $STORE_OBJS|sed -e's%fs/%%g'`" +STORE_LIBS="`echo $STORE_OBJS|sed -e 's%fs/%%g'`" AC_SUBST(STORE_LIBS) dnl --enable-heap-replacement compability option @@ -365,9 +364,9 @@ ]) echo "Removal policies built: $REPL_POLICIES" AC_SUBST(REPL_POLICIES) -REPL_OBJS="repl/`echo $REPL_POLICIES|sed -e's% %.a repl/%g'`.a" +REPL_OBJS="repl/`echo $REPL_POLICIES|sed -e 's% %.a repl/%g'`.a" AC_SUBST(REPL_OBJS) -REPL_LIBS="`echo $REPL_OBJS|sed -e's%repl/%%g'`" +REPL_LIBS="`echo $REPL_OBJS|sed -e 's%repl/%%g'`" AC_SUBST(REPL_LIBS) OPT_PINGER_EXE='' @@ -382,7 +381,7 @@ AC_SUBST(OPT_PINGER_EXE) AC_ARG_ENABLE(delay-pools, -[ --enable-delay-pools Enable delay pools to limit bandwith usage], +[ --enable-delay-pools Enable delay pools to limit bandwidth usage], [ if test "$enableval" = "yes" ; then echo "Delay pools enabled" DELAY_OBJS='$(DELAY_OBJS)' @@ -512,7 +511,7 @@ AC_ARG_ENABLE(cache-digests, [ --enable-cache-digests Use Cache Digests - see http://squid.nlanr.net/Squid/FAQ/FAQ-16.html], + see http://www.squid-cache.org/FAQ/FAQ-16.html], [ if test "$enableval" = "yes" ; then echo "USE_CACHE_DIGESTS enabled" AC_DEFINE(USE_CACHE_DIGESTS) @@ -588,6 +587,17 @@ fi ]) +dnl Enable Linux Netfilter (2.4) Transparent Proxy +AC_ARG_ENABLE(linux-netfilter, +[ --enable-linux-netfilter + Enable Transparent Proxy support for Linux 2.4.], +[ if test "$enableval" = "yes" ; then + echo "Linux-Netfilter Transparent Proxy enabled" + AC_DEFINE(LINUX_NETFILTER) + LINUX_NETFILTER="yes" + fi +]) + dnl Enable Leak Finding Functions AC_ARG_ENABLE(leakfinder, [ --enable-leakfinder @@ -604,7 +614,6 @@ ]) AC_SUBST(LEAKFINDER_OBJS) -dnl Disable HTTP violations AC_ARG_ENABLE(ident-lookups, [ --disable-ident-lookups This allows you to remove code that performs @@ -654,7 +663,7 @@ dnl Enable underscore in hostnames AC_ARG_ENABLE(underscores, [ --enable-underscores Squid by default rejects any host names with _ - in their name to conform with internet standars. + in their name to conform with internet standards. If you disagree with this you may allow _ in hostnames by using this switch, provided that the resolver library on the host where Squid runs @@ -665,32 +674,143 @@ fi ]) -dnl Select auth modules to build -AUTH_MODULES= + +dnl Select auth schemes modules to build +AC_ARG_ENABLE(auth, +[ --enable-auth=\"list of auth scheme modules\" + Build support for the list of authentication schemes. + The default is to build support for the Basic scheme. + See src/auth for a list of available modules, or + Programmers Guide section authentication schemes + for details on how to build your custom auth scheme + module], +[ case $enableval in + yes) + for module in $srcdir/src/auth/*; do + if test -f $module/Makefile.in; then + AUTH_MODULES="$AUTH_MODULES `basename $module`" + fi + done + ;; + no) + ;; + *) AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" + ;; + esac +], +[ if test -z "$AUTH_MODULES"; then + AUTH_MODULES="basic" + fi +]) +echo "Auth scheme modules built: $AUTH_MODULES" +AC_SUBST(AUTH_MODULES) +AUTH_OBJS="auth/`echo $AUTH_MODULES|sed -e 's% %.a auth/%g'`.a" +AC_SUBST(AUTH_OBJS) +AUTH_LIBS="`echo $AUTH_OBJS|sed -e 's%auth/%%g'`" +AC_SUBST(AUTH_LIBS) + +dnl Select basic auth scheme helpers to build +BASIC_AUTH_HELPERS="" AC_ARG_ENABLE(auth-modules, -[ --enable-auth-modules=\"list of modules\" - This option selects wich proxy_auth helper modules - to build and install as part of the normal build +[ --enable-auth-modules=\"list of helpers\" + Backwards compability alias for + --enable-basic-auth-helpers], +[ echo "--enable-auth-modules is obsolete. Please use the new" + echo "option --enable-basic-auth-helpers" + sleep 5 + case "$enableval" in + yes) + for helper in $srcdir/src/auth/basic/helpers/*; do + if test -f $helper/Makefile.in; then + BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`" + fi + done + ;; + no) + ;; + *) + BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" + esac +]) +AC_ARG_ENABLE(basic-auth-helpers, +[ --enable-basic-auth-helpers=\"list of helpers\" + This option selects which basic scheme proxy_auth + helpers to build and install as part of the normal + build process. For a list of available + helpers see the src/auth/basic/helpers directory.], +[ case "$enableval" in + yes) + BASIC_AUTH_HELPERS="" + for helper in $srcdir/src/auth/basic/helpers/*; do + if test -f $helper/Makefile.in; then + BASIC_AUTH_HELPERS="$BASIC_AUTH_HELPERS `basename $helper`" + fi + done + ;; + no) + ;; + *) + BASIC_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" + esac +]) +if test -n "$BASIC_AUTH_HELPERS"; then + echo "Basic auth helpers built: $BASIC_AUTH_HELPERS" +fi +AC_SUBST(BASIC_AUTH_HELPERS) + +dnl Select ntlm auth helpers to build +NTLM_AUTH_HELPERS= +AC_ARG_ENABLE(ntlm-auth-helpers, +[ --enable-ntlm-auth-helpers=\"list of helpers\" + This option selects which proxy_auth ntlm helpers + to build and install as part of the normal build process. For a list of available modules see - the auth_modules directory.], + the src/auth/ntlm/helpers directory.], [ case "$enableval" in yes) - for module in $srcdir/auth_modules/*; do - if test -f $module/Makefile.in; then - AUTH_MODULES="$AUTH_MODULES `basename $module`" + for helper in $srcdir/src/auth/ntlm/helpers/*; do + if test -f $helper/Makefile.in; then + NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS `basename $helper`" fi done ;; no) ;; *) - AUTH_MODULES="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" + NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" esac ]) -if test -n "$AUTH_MODULES"; then - echo "Auth moules built: $AUTH_MODULES" +if test -n "$NTLM_AUTH_HELPERS"; then + echo "NTLM auth helpers built: $NTLM_AUTH_HELPERS" fi -AC_SUBST(AUTH_MODULES) +AC_SUBST(NTLM_AUTH_HELPERS) + +dnl Select digest auth scheme helpers to build +DIGEST_AUTH_HELPERS= +AC_ARG_ENABLE(digest-auth-helpers, +[ --enable-digest-auth-helpers=\"list of helpers\" + This option selects which digest scheme authentication + helpers to build and install as part of the normal build + process. For a list of available modules see the + src/auth/digest/helpers directory.], +[ case "$enableval" in + yes) + for helper in $srcdir/src/auth/digest/helpers/*; do + if test -f $helper/Makefile.in; then + DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS `basename $helper`" + fi + done + ;; + no) + ;; + *) + DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/ */ /g'`" + esac +]) +if test -n "$DIGEST_AUTH_HELPERS"; then + echo "Digest auth helpers built: $DIGEST_AUTH_HELPERS" +fi +AC_SUBST(DIGEST_AUTH_HELPERS) dnl Disable "unlinkd" code AC_ARG_ENABLE(unlinkd, @@ -909,10 +1029,16 @@ AC_PATH_PROG(MV, mv, $FALSE) AC_PATH_PROG(MKDIR, mkdir, $FALSE) AC_PATH_PROG(LN, ln, cp) -AC_PATH_PROG(PERL, perl, /usr/local/bin/perl) +AC_PATH_PROG(PERL, perl, none) AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUE) AC_PATH_PROG(AR, ar, $FALSE) +if test "$ac_cv_path_PERL" = "none"; then + echo "Perl is required to compile Squid" + echo "Please install Perl and then re-run configure" + exit 1 +fi + case "$host" in *-hp-hpux*) echo "Disabling 'ranlib' for HP-UX..." @@ -953,6 +1079,7 @@ ip_nat.h \ libc.h \ limits.h \ + linux/netfilter_ipv4.h \ malloc.h \ math.h \ memory.h \ @@ -988,7 +1115,6 @@ sys/socket.h \ sys/stat.h \ sys/statvfs.h \ - sys/vfs.h \ sys/syscall.h \ sys/time.h \ sys/types.h \ @@ -999,6 +1125,8 @@ time.h \ unistd.h \ varargs.h \ + byteswap.h \ + glib.h \ ) AC_C_CONST @@ -1098,12 +1226,68 @@ fi dnl Check for typedefs +AC_CHECK_SIZEOF(void *) +AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(void *) - -dnl Check for special functions -AC_FUNC_ALLOCA +AC_CHECK_SIZEOF(long long) +AC_CHECK_SIZEOF(__int64) +AC_CHECK_SIZEOF(int16_t) +AC_CHECK_SIZEOF(uint16_t) +AC_CHECK_SIZEOF(u_int16_t) +AC_CHECK_SIZEOF(int32_t) +AC_CHECK_SIZEOF(uint32_t) +AC_CHECK_SIZEOF(u_int32_t) +AC_CHECK_SIZEOF(int64_t) +AC_CHECK_SIZEOF(uint64_t) +AC_CHECK_SIZEOF(u_int64_t) + +dnl int16_t +if test "x$ac_cv_sizeof_short" = "x2"; then + AC_CHECK_TYPE(int16_t,short) +elif test "x$ac_cv_sizeof_int" = "x2"; then + AC_CHECK_TYPE(int16_t,int) +fi +dnl u_int16t_t +if test "x$ac_cv_sizeof_uint16_t" = "x2"; then + AC_CHECK_TYPE(u_int16_t,uint16_t) +elif test "x$ac_cv_sizeof_short" = "x2"; then + AC_CHECK_TYPE(u_int16_t,unsigned short) +elif test "x$ac_cv_sizeof_int" = "x2"; then + AC_CHECK_TYPE(u_int16_t,unsigned int) +fi +dnl int32_t +if test "x$ac_cv_sizeof_int" = "x4"; then + AC_CHECK_TYPE(int32_t,int) +elif "x$ac_cv_sizeof_long" = "x4"; then + AC_CHECK_TYPE(int32_t,long) +fi +dnl u_int32_t +if test "x$ac_cv_sizeof_uint32_t" = "x4"; then + AC_CHECK_TYPE(u_int32_t,uint32_t) +elif test "x$ac_cv_sizeof_int" = "x4"; then + AC_CHECK_TYPE(u_int32_t,unsigned int) +elif test "x$ac_cv_sizeof_long" = "x4"; then + AC_CHECK_TYPE(u_int32_t,unsigned long) +fi +dnl int64_t +if test "x$ac_cv_sizeof_long" = "x8"; then + AC_CHECK_TYPE(int64_t,long) +elif test "x$ac_cv_sizeof_long_long" = "x8"; then + AC_CHECK_TYPE(int64_t,long long) +elif test "x$ac_cv_sizeof___int64" = "x8"; then + AC_CHECK_TYPE(int64_t,__int64) +fi +dnl u_int64_t +if test "x$ac_cv_sizeof_uint64_t" = "x8"; then + AC_CHECK_TYPE(u_int64_t,uint64_t) +elif test "x$ac_cv_sizeof_long" = "x8"; then + AC_CHECK_TYPE(u_int64_t,unsigned long) +elif test "x$ac_cv_sizeof_long_long" = "x8"; then + AC_CHECK_TYPE(u_int64_t,unsigned long long) +elif test "x$ac_cv_sizeof___int64" = "x8"; then + AC_CHECK_TYPE(int64_t,unsigned __int64) +fi AC_CHECK_TYPE(pid_t, int) AC_CHECK_TYPE(size_t, unsigned int) @@ -1112,6 +1296,10 @@ AC_CHECK_TYPE(mode_t, u_short) AC_CHECK_TYPE(fd_mask, int) +dnl Check for special functions +AC_FUNC_ALLOCA + + dnl Check for type in sys/socket.h AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [ AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include @@ -1329,6 +1517,7 @@ memcpy \ memmove \ memset \ + mkstemp \ mktime \ mstats \ poll \ @@ -1358,6 +1547,8 @@ syslog \ timegm \ vsnprintf \ + bswap_16 \ + bswap_32 \ ) dnl Yay! Another Linux brokenness. Its not good enough @@ -1413,6 +1604,26 @@ sleep 10 fi +dnl Linux-Netfilter support requires Linux 2.4 kernel header files. +dnl Shamelessly copied from above +if test "$LINUX_NETFILTER" ; then + AC_MSG_CHECKING(if Linux 2.4 kernel header files are installed) + # hold on to your hats... + if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then + LINUX_NETFILTER="yes" + AC_DEFINE(LINUX_NETFILTER, 1) + else + LINUX_NETFILTER="no" + AC_DEFINE(LINUX_NETFILTER, 0) + fi + AC_MSG_RESULT($LINUX_NETFILTER) +fi +if test "$LINUX_NETFILTER" = "no" ; then + echo "WARNING: Cannot find necessary Linux 2.4 kernel header files" + echo " Linux 2.4 Transparent Proxy support WILL NOT be enabled" + sleep 10 +fi + if test -z "$USE_GNUREGEX" ; then case "$host" in *-sun-solaris2.[[0-4]]) @@ -1554,7 +1765,7 @@ if test "$SQUID_MAXFD" -lt 512 ; then echo "WARNING: $SQUID_MAXFD may not be enough filedescriptors if your" echo " cache will be very busy. Please see the FAQ page" - echo " http://squid.nlanr.net/Squid/FAQ/FAQ-11.html#filedescriptors" + echo " http://www.squid-cache.org/FAQ/FAQ-11.html#filedescriptors" echo " on how to increase your filedescriptor limit" sleep 10 fi @@ -1823,10 +2034,12 @@ fi done +dnl This could actually be used to find all the Makefiles.. AUTH_MAKEFILES="" -for module in $srcdir/auth_modules/*; do - if test -f $module/Makefile.in; then - AUTH_MAKEFILES="$AUTH_MAKEFILES ./auth_modules/`basename $module`/Makefile" +for auth in `find $srcdir/src/auth -type d -print`; do + if test -f $auth/Makefile.in; then + dir=`echo $auth | sed -e "s|^$srcdir/||"` + AUTH_MAKEFILES="$AUTH_MAKEFILES ./$dir/Makefile" fi done @@ -1842,10 +2055,10 @@ $FS_MAKEFILES \ ./src/repl/Makefile \ $REPL_MAKEFILES \ + ./src/auth/Makefile \ + $AUTH_MAKEFILES \ ./contrib/Makefile \ $SNMP_MAKEFILE \ ./icons/Makefile \ ./errors/Makefile \ - ./auth_modules/Makefile \ - $AUTH_MAKEFILES \ ) Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -u -r1.5.2.2 -r1.5.2.3 --- squid/src/access_log.c 27 Feb 2001 14:18:50 -0000 1.5.2.2 +++ squid/src/access_log.c 28 Feb 2001 05:24:02 -0000 1.5.2.3 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.5.2.2 2001/02/27 14:18:50 rvenning Exp $ + * $Id: access_log.c,v 1.5.2.3 2001/02/28 05:24:02 rvenning Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -267,13 +267,8 @@ if (Config.onoff.log_fqdn) client = fqdncache_gethostbyaddr(al->cache.caddr, 0); if (client == NULL) -<<<<<<< access_log.c client = INET_NTOA(al->cache.caddr); - logfilePrintf(logfile, "%s %s - [%s] \"%s %s HTTP/%d.%d\" %d %d %s:%s", -======= - client = inet_ntoa(al->cache.caddr); logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %d %s:%s", ->>>>>>> 1.10 client, accessLogFormatName(al->cache.rfc931), (user = accessLogFormatName(al->cache.authuser)), Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.c,v retrieving revision 1.4.6.2 retrieving revision 1.4.6.3 diff -u -r1.4.6.2 -r1.4.6.3 --- squid/src/acl.c 27 Feb 2001 14:18:50 -0000 1.4.6.2 +++ squid/src/acl.c 28 Feb 2001 05:24:02 -0000 1.4.6.3 @@ -1,6 +1,6 @@ /* - * $Id: acl.c,v 1.4.6.2 2001/02/27 14:18:50 rvenning Exp $ + * $Id: acl.c,v 1.4.6.3 2001/02/28 05:24:02 rvenning Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -62,13 +62,8 @@ static int aclMatchAcl(struct _acl *, aclCheck_t *); static int aclMatchIntegerRange(intrange * data, int i); static int aclMatchTime(acl_time_data * data, time_t when); -<<<<<<< acl.c -static int aclMatchUser(wordlist * data, const char *ident); -static int aclMatchIp(void *dataptr, struct IN_ADDR c); -======= static int aclMatchUser(void *proxyauth_acl, char *user); -static int aclMatchIp(void *dataptr, struct in_addr c); ->>>>>>> 1.23 +static int aclMatchIp(void *dataptr, struct IN_ADDR c); static int aclMatchDomainList(void *dataptr, const char *); static int aclMatchIntegerRange(intrange * data, int i); #if SQUID_SNMP @@ -1212,64 +1207,6 @@ * deny access: clientreadrequest requires conn data, and it is always * compiled in so we should have it too. */ -<<<<<<< acl.c - assert(auth_user == checklist->auth_user); - checklist->auth_user = NULL; /* get rid of that special reference */ - /* Check result from external validation */ - if (auth_user->passwd_ok != 1) { - /* password was checked but did not match */ - assert(auth_user->passwd_ok == 0); - debug(28, 4) ("aclMatchProxyAuth: authentication failed for user '%s'\n", - user); - aclFreeProxyAuthUser(auth_user); - /* - * copy username to request for logging on client-side - * unless ident is known (do not override ident with - * false proxy auth names) - */ - if (!*checklist->request->user_ident) - xstrncpy(checklist->request->user_ident, user, USER_IDENT_SZ); - return -2; - } else { - /* password was checked and did match */ - debug(28, 4) ("aclMatchProxyAuth: user '%s' validated OK\n", user); - /* store validated user in hash, after filling in expiretime */ - xstrncpy(checklist->request->user_ident, user, USER_IDENT_SZ); - auth_user->expiretime = current_time.tv_sec + Config.authenticateTTL; - auth_user->ip_expiretime = squid_curtime + Config.authenticateIpTTL; - auth_user->ipaddr = checklist->src_addr; - hash_join(proxy_auth_cache, &auth_user->hash); - /* Continue checking below, as normal */ - } - } - /* see if we already know this user */ - auth_user = hash_lookup(proxy_auth_cache, user); - - if (!auth_user) { - /* user not yet known, ask external authenticator */ - debug(28, 4) ("aclMatchProxyAuth: user '%s' not yet known\n", user); - return -1; - } else if ((0 == strcmp(auth_user->passwd, password)) && - (auth_user->expiretime > current_time.tv_sec)) { - if (memcmp(&checklist->src_addr, &auth_user->ipaddr, sizeof(struct IN_ADDR)) == 0 - || auth_user->ip_expiretime <= squid_curtime) { - /* user already known and valid */ - debug(28, 5) ("aclMatchProxyAuth: user '%s' previously validated\n", - user); - /* Update IP ttl */ - auth_user->ip_expiretime = squid_curtime + Config.authenticateIpTTL; - auth_user->ipaddr = checklist->src_addr; - /* copy username to request for logging on client-side */ - xstrncpy(checklist->request->user_ident, user, USER_IDENT_SZ); - switch (acltype) { - case ACL_PROXY_AUTH: - return aclMatchUser(data, user); - case ACL_PROXY_AUTH_REGEX: - return aclMatchRegex(data, user); - default: - fatal("aclMatchProxyAuth: unknown ACL type"); - return 0; /* NOTREACHED */ -======= return 0; } if (((proxy_auth == NULL) && (checklist->conn->auth_type == AUTH_UNKNOWN)) || (checklist->conn->auth_type == AUTH_BROKEN)) { @@ -1304,7 +1241,6 @@ authenticateAuthUserRequestUnlock(auth_user_request); } return -2; ->>>>>>> 1.23 } /* the user_request comes prelocked for the caller to GetAuthUser (us) */ } else if (checklist->request->auth_user_request) { @@ -2282,7 +2218,6 @@ *(p1++) &= *(p2++); } -<<<<<<< acl.c if (ADDR_IS_ANYADDR(C)) { return memcmp(&A, &B, sizeof(struct IN_ADDR)); } else { @@ -2292,8 +2227,6 @@ static void -======= -static void aclDumpUserListWalkee(void *node_data, void *outlist) { /* outlist is really a wordlist ** */ @@ -2318,7 +2251,6 @@ } static void ->>>>>>> 1.23 aclDumpIpListWalkee(void *node, void *state) { acl_ip_data *ip = node; Index: squid/src/authenticate.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -u -r1.4.6.1 -r1.4.6.2 --- squid/src/authenticate.c 27 Feb 2001 14:18:51 -0000 1.4.6.1 +++ squid/src/authenticate.c 28 Feb 2001 05:24:02 -0000 1.4.6.2 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.4.6.1 2001/02/27 14:18:51 rvenning Exp $ + * $Id: authenticate.c,v 1.4.6.2 2001/02/28 05:24:02 rvenning Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -234,10 +234,11 @@ } void -authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct in_addr ipaddr) +authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, +struct IN_ADDR ipaddr) { if (auth_user_request->auth_user) - if (!auth_user_request->auth_user->ipaddr.s_addr) + if (ADDR_IS_NOADDR(auth_user_request->auth_user->ipaddr)) auth_user_request->auth_user->ipaddr = ipaddr; } @@ -675,10 +676,11 @@ /* TODO: * ip_expire data should be in a struct of it's own - for code reuse */ int -authenticateCheckAuthUserIP(struct in_addr request_src_addr, auth_user_request_t * auth_user_request) +authenticateCheckAuthUserIP(struct IN_ADDR request_src_addr, auth_user_request_t * auth_user_request) { char *username = authenticateUserRequestUsername(auth_user_request); - if (request_src_addr.s_addr == auth_user_request->auth_user->ipaddr.s_addr || auth_user_request->auth_user->ip_expiretime + Config.authenticateIpTTL <= squid_curtime) { + if (!memcmp(&request_src_addr, &auth_user_request->auth_user->ipaddr, sizeof(struct IN_ADDR)) || + auth_user_request->auth_user->ip_expiretime + Config.authenticateIpTTL <= squid_curtime) { /* user has not moved ip or had the ip timeout expire */ if ((auth_user_request->auth_user->auth_type == AUTH_UNKNOWN) || (auth_user_request->auth_user->auth_type == AUTH_BROKEN)) { @@ -691,13 +693,13 @@ auth_user_request->auth_user->ipaddr = request_src_addr; return 1; } else { - char *ip1 = xstrdup(inet_ntoa(auth_user_request->auth_user->ipaddr)); - char *ip2 = xstrdup(inet_ntoa(request_src_addr)); + char *ip1 = xstrdup(INET_NTOA(auth_user_request->auth_user->ipaddr)); + char *ip2 = xstrdup(INET_NTOA(request_src_addr)); if (Config.onoff.authenticateIpTTLStrict) { debug(29, 1) ("aclMatchProxyAuth: user '%s' tried to use multiple IP addresses! (%s, %s)\n ", username, ip1, ip2); } else { /* Non-strict mode. Reassign ownership to the new IP */ - auth_user_request->auth_user->ipaddr.s_addr = request_src_addr.s_addr; + auth_user_request->auth_user->ipaddr = request_src_addr; debug(29, 1) ("aclMatchProxyAuth: user '%s' has changed IP address (%s, %s)\n ", username, ip1, ip2); } safe_free(ip1); Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -r1.4.2.3 -r1.4.2.4 --- squid/src/cache_cf.c 27 Feb 2001 14:18:51 -0000 1.4.2.3 +++ squid/src/cache_cf.c 28 Feb 2001 05:24:03 -0000 1.4.2.4 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.4.2.3 2001/02/27 14:18:51 rvenning Exp $ + * $Id: cache_cf.c,v 1.4.2.4 2001/02/28 05:24:03 rvenning Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -822,22 +822,6 @@ safe_free(new_string); } } -<<<<<<< cache_cf.c - while ((t = strtok(NULL, w_space))) { - if ((id = httpHeaderIdByNameDef(t, strlen(t))) == -1) - debug(3, 0) ("parse_http_header: Ignoring unknown header '%s'\n", t); - else if (allowed) - CBIT_CLR(*header, id); - else - CBIT_SET(*header, id); - } -} - -static void -free_http_header(HttpHeaderMask * header) -{ - httpHeaderMaskInit(header, 0); -======= } static void @@ -860,12 +844,9 @@ storeAppendPrintf(entry, "%s %s %s\n", name, httpHeaderNameById(i), header[i].replacement); } ->>>>>>> 1.20 } static void -<<<<<<< cache_cf.c -======= parse_http_header_replace(header_mangler header[]) { int id, i; @@ -913,7 +894,6 @@ } static void ->>>>>>> 1.20 dump_cachedir(StoreEntry * entry, const char *name, cacheSwap swap) { SwapDir *s; @@ -1282,20 +1262,6 @@ p->http_port = (u_short) i; i = GetInteger(); p->icp.port = (u_short) i; -<<<<<<< cache_cf.c - if (strcmp(p->host, me) == 0) { - for (s = Config.Sockaddr.http; s; s = s->next) { - if (p->http_port != ntohs(PORT_FROM_SA(s->s))) - continue; - debug(15, 1) ("parse_peer: Peer looks like myself: Ignoring %s %s/%d/%d\n", - neighborTypeStr(p), p->host, p->http_port, p->icp.port); - xfree( p->host ); - memFree( p, MEM_PEER ); - return; - } - } -======= ->>>>>>> 1.20 while ((token = strtok(NULL, w_space))) { if (!strcasecmp(token, "proxy-only")) { p->options.proxy_only = 1; Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -r1.7.2.2 -r1.7.2.3 --- squid/src/client_side.c 27 Feb 2001 14:18:51 -0000 1.7.2.2 +++ squid/src/client_side.c 28 Feb 2001 05:24:03 -0000 1.7.2.3 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.7.2.2 2001/02/27 14:18:51 rvenning Exp $ + * $Id: client_side.c,v 1.7.2.3 2001/02/28 05:24:03 rvenning Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -264,10 +264,7 @@ } err = errorCon(page_id, status); err->request = requestLink(http->request); -<<<<<<< client_side.c err->src_addr = ADDR_FROM_SA(http->conn->peer); -======= - err->src_addr = http->conn->peer.sin_addr; if (http->conn->auth_user_request) err->auth_user_request = http->conn->auth_user_request; else if (http->request->auth_user_request) @@ -276,7 +273,6 @@ if (err->auth_user_request) authenticateAuthUserRequestLock(err->auth_user_request); err->callback_data = NULL; ->>>>>>> 1.21 errorAppendEntry(http->entry, err); } } @@ -817,12 +813,8 @@ clientHttpRequest *http; debug(33, 3) ("connStateFree: FD %d\n", fd); assert(connState != NULL); -<<<<<<< client_side.c - clientdbEstablished(ADDR_FROM_SA(connState->peer), -1); /* decrement */ -======= authenticateOnCloseConnection(connState); - clientdbEstablished(connState->peer.sin_addr, -1); /* decrement */ ->>>>>>> 1.21 + clientdbEstablished(ADDR_FROM_SA(connState->peer), -1); /* decrement */ while ((http = connState->chr) != NULL) { assert(http->conn == connState); assert(connState->chr != connState->chr->next); @@ -2475,7 +2467,7 @@ int vport; char *q; if (vport_mode) - vport = (int) ntohs(http->conn->me.sin_port); + vport = (int) ntohs(PORT_FROM_SA(http->conn->me)); else vport = (int) Config.Accel.port; /* If a Host: header was specified, use it to build the URL Index: squid/src/ipcache.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ipcache.c,v retrieving revision 1.4.6.3 retrieving revision 1.4.6.4 diff -u -r1.4.6.3 -r1.4.6.4 --- squid/src/ipcache.c 27 Feb 2001 14:18:52 -0000 1.4.6.3 +++ squid/src/ipcache.c 28 Feb 2001 05:24:03 -0000 1.4.6.4 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.c,v 1.4.6.3 2001/02/27 14:18:52 rvenning Exp $ + * $Id: ipcache.c,v 1.4.6.4 2001/02/28 05:24:03 rvenning Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -292,7 +292,7 @@ i.addrs.bad_mask = xcalloc(ipcount, sizeof(unsigned char)); } for (j = 0, k = 0; k < ipcount; k++) { - if (safe_inet_addr(A[k], &(i.addrs.in_addrs[j]))) + if (SAFE_INET_ADDR(A[k], &(i.addrs.in_addrs[j]))) j++; else debug(14, 1) ("ipcacheParse: Invalid IP address '%s'\n", A[k]); @@ -726,7 +726,7 @@ ipcacheAddEntryFromHosts(const char *name, const char *ipaddr) { ipcache_entry *i; - struct in_addr ip; + struct IN_ADDR ip; if (!safe_inet_addr(ipaddr, &ip)) { debug(14, 1) ("ipcacheAddEntryFromHosts: bad IP address '%s'\n", ipaddr); @@ -749,7 +749,7 @@ i->addrs.badcount = 0; i->addrs.in_addrs = xcalloc(1, sizeof(struct in_addr)); i->addrs.bad_mask = xcalloc(1, sizeof(unsigned char)); - i->addrs.in_addrs[0].s_addr = ip.s_addr; + i->addrs.in_addrs[0] = ip; i->addrs.bad_mask[0] = FALSE; i->flags.fromhosts = 1; ipcacheAddEntry(i); Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/neighbors.c,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -u -r1.5.4.2 -r1.5.4.3 --- squid/src/neighbors.c 27 Feb 2001 14:18:52 -0000 1.5.4.2 +++ squid/src/neighbors.c 28 Feb 2001 05:24:03 -0000 1.5.4.3 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.5.4.2 2001/02/27 14:18:52 rvenning Exp $ + * $Id: neighbors.c,v 1.5.4.3 2001/02/28 05:24:03 rvenning Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -351,14 +351,10 @@ struct SOCKADDR_IN name; socklen_t len = sizeof(struct SOCKADDR_IN); struct servent *sep = NULL; -<<<<<<< neighbors.c - memset(&name, '\0', sizeof(struct SOCKADDR_IN)); -======= const char *me = getMyHostname(); peer *this; peer *next; - memset(&name, '\0', sizeof(struct sockaddr_in)); ->>>>>>> 1.8 + memset(&name, '\0', sizeof(struct SOCKADDR_IN)); if (getsockname(fd, (struct sockaddr *) &name, &len) < 0) debug(15, 1) ("getsockname(%d,%p,%p) failed.\n", fd, &name, &len); for (this = Config.peers; this; this = next) { @@ -367,7 +363,7 @@ if (0 != strcmp(this->host, me)) continue; for (s = Config.Sockaddr.http; s; s = s->next) { - if (this->http_port != ntohs(s->s.sin_port)) + if (this->http_port != ntohs(PORT_FROM_SA(s->s))) continue; debug(15, 1) ("WARNING: Peer looks like this host\n"); debug(15, 1) (" Ignoring %s %s/%d/%d\n", Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -u -r1.5.2.2 -r1.5.2.3 --- squid/src/protos.h 27 Feb 2001 14:18:52 -0000 1.5.2.2 +++ squid/src/protos.h 28 Feb 2001 05:24:04 -0000 1.5.2.3 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.5.2.2 2001/02/27 14:18:52 rvenning Exp $ + * $Id: protos.h,v 1.5.2.3 2001/02/28 05:24:04 rvenning Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -740,7 +740,7 @@ extern void authenticateAuthUserRequestLock(auth_user_request_t *); extern char *authenticateAuthUserRequestMessage(auth_user_request_t *); extern int authenticateAuthUserInuse(auth_user_t * auth_user); -extern void authenticateAuthUserRequestSetIp(auth_user_request_t *, struct in_addr); +extern void authenticateAuthUserRequestSetIp(auth_user_request_t *, struct IN_ADDR); extern int authenticateDirection(auth_user_request_t *); extern FREE authenticateFreeProxyAuthUser; extern void authenticateFreeProxyAuthUserACLResults(void *data); @@ -749,7 +749,7 @@ extern int authenticateActiveSchemeCount(void); extern int authenticateSchemeCount(void); extern void authenticateUserNameCacheAdd(auth_user_t * auth_user); -extern int authenticateCheckAuthUserIP(struct in_addr request_src_addr, auth_user_request_t * auth_user); +extern int authenticateCheckAuthUserIP(struct IN_ADDR request_src_addr, auth_user_request_t * auth_user); extern int authenticateUserAuthenticated(auth_user_request_t *); extern void authenticateUserCacheRestart(void); extern char *authenticateUserUsername(auth_user_t *); Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/tools.c,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -r1.4.2.3 -r1.4.2.4 --- squid/src/tools.c 27 Feb 2001 14:18:53 -0000 1.4.2.3 +++ squid/src/tools.c 28 Feb 2001 05:24:04 -0000 1.4.2.4 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.4.2.3 2001/02/27 14:18:53 rvenning Exp $ + * $Id: tools.c,v 1.4.2.4 2001/02/28 05:24:04 rvenning Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -464,13 +464,8 @@ return host; } -<<<<<<< tools.c debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n", SA_NTOA(Config.Sockaddr.http->s)); -======= - debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n", - inet_ntoa(Config.Sockaddr.http->s.sin_addr)); ->>>>>>> 1.11 } /* * Get the host name and store it in host to return Index: squid/src/whois.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/whois.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -r1.3 -r1.3.6.1 --- squid/src/whois.c 23 Oct 2000 15:04:22 -0000 1.3 +++ squid/src/whois.c 28 Feb 2001 05:24:04 -0000 1.3.6.1 @@ -1,21 +1,21 @@ /* - * $Id: whois.c,v 1.3 2000/10/23 15:04:22 hno Exp $ + * $Id: whois.c,v 1.3.6.1 2001/02/28 05:24:04 rvenning Exp $ * * DEBUG: section 75 WHOIS protocol * AUTHOR: Duane Wessels, Kostas Anagnostakis * - * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * SQUID Web Proxy Cache http://www.squid-cache.org/ * ---------------------------------------------------------- * - * Squid is the result of efforts by numerous individuals from the - * Internet community. Development is led by Duane Wessels of the - * National Laboratory for Applied Network Research and funded by the - * National Science Foundation. Squid is Copyrighted (C) 1998 by - * the Regents of the University of California. Please see the - * COPYRIGHT file for full details. Squid incorporates software - * developed and/or copyrighted by other sources. Please see the - * CREDITS file for full details. + * Squid is the result of efforts by numerous individuals from + * the Internet community; see the CONTRIBUTORS file for full + * details. Many organizations have provided support for Squid's + * development; see the SPONSORS file for full details. Squid is + * Copyrighted (C) 2001 by the Regents of the University of + * California; see the COPYRIGHT file for full details. Squid + * incorporates software developed and/or copyrighted by other + * sources; see the CREDITS file for full details. * * 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 @@ -49,17 +49,20 @@ /* PUBLIC */ +CBDATA_TYPE(WhoisState); + void whoisStart(FwdState * fwd) { - WhoisState *p = xcalloc(1, sizeof(*p)); + WhoisState *p; int fd = fwd->server_fd; char *buf; size_t l; + CBDATA_INIT_TYPE(WhoisState); + p = CBDATA_ALLOC(WhoisState, NULL); p->request = fwd->request; p->entry = fwd->entry; p->fwd = fwd; - cbdataAdd(p, cbdataXfree, 0); storeLockObject(p->entry); comm_add_close_handler(fd, whoisClose, p); l = strLen(p->request->urlpath) + 3;