This patch adds the allow_underscore squid.conf directive.
Also changed the check_hostnames directive like in Squid 2.6, but off
by default.
dnl Configuration input file for Squid
dnl
-dnl $Id: configure.in,v 1.447 2006/12/24 14:19:27 serassio Exp $
+dnl $Id: configure.in,v 1.448 2007/04/07 09:35:37 serassio Exp $
dnl
dnl
dnl
AC_CONFIG_AUX_DIR(cfgaux)
AC_CONFIG_SRCDIR([src/main.cc])
AM_INIT_AUTOMAKE([tar-ustar])
-AC_REVISION($Revision: 1.447 $)dnl
+AC_REVISION($Revision: 1.448 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
fi
])
-dnl Disable hostname checks
-AC_ARG_ENABLE(hostname-checks,
-[ --enable-hostname-checks
- Tells Squid to rejects any host names with
- odd characters in their name to conform with
- internet standards. This was the default in
- prior Squid versions, but since Squid-3 Squid
- no longer tries to police the use of DNS],
-[ if test "$enableval" = "yes"; then
- echo "Enabling hostname sanity checks"
- AC_DEFINE(CHECK_HOSTNAMES, 1, [Enable hostname sanity checks])
- fi
-])
-
-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 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
- does not reject _ in hostnames...],
-[ if test "$enableval" = "yes" ; then
- echo "Enabling the use of underscores in host names"
- AC_DEFINE(ALLOW_HOSTNAME_UNDERSCORES, 1,[Allow underscores in host names])
- fi
-])
-
dnl Select Default hosts file location
AC_ARG_ENABLE(default-hostsfile,
[ --enable-default-hostsfile=path
#
-# $Id: cf.data.pre,v 1.430 2007/04/06 04:50:05 rousskov Exp $
+# $Id: cf.data.pre,v 1.431 2007/04/07 09:35:38 serassio Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
NAME: check_hostnames
TYPE: onoff
-DEFAULT: on
+DEFAULT: off
LOC: Config.onoff.check_hostnames
DOC_START
- For security and stability reasons Squid by default checks
- hostnames for Internet standard RFC compliance. If you do not want
- Squid to perform these checks turn this directive off.
+ For security and stability reasons Squid can check
+ hostnames for Internet standard RFC compliance. If you want
+ Squid to perform these checks turn this directive on.
+DOC_END
+
+NAME: allow_underscore
+TYPE: onoff
+DEFAULT: on
+LOC: Config.onoff.allow_underscore
+DOC_START
+ Underscore characers is not strictly allowed in Internet hostnames
+ but nevertheless used by many sites. Set this to off if you want
+ Squid to be strict about the standard.
+ This check is performed only when check_hostnames is set to on.
DOC_END
NAME: ftp_telnet_protocol
/*
- * $Id: structs.h,v 1.552 2007/04/06 04:50:06 rousskov Exp $
+ * $Id: structs.h,v 1.553 2007/04/07 09:35:38 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
int balance_on_multiple_ip;
int relaxed_header_parser;
int check_hostnames;
+ int allow_underscore;
int via;
int emailErrData;
int httpd_suppress_version_string;
/*
- * $Id: url.cc,v 1.155 2006/05/29 21:44:18 robertc Exp $
+ * $Id: url.cc,v 1.156 2007/04/07 09:35:38 serassio Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
#include "URLScheme.h"
static HttpRequest *urnParse(method_t method, char *urn);
-#if CHECK_HOSTNAMES
-static const char *const valid_hostname_chars =
-#if ALLOW_HOSTNAME_UNDERSCORES
+static const char valid_hostname_chars_u[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
- "0123456789-._";
-#else
+ "0123456789-._"
+ ;
+static const char valid_hostname_chars[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789-."
;
-#endif
-#endif /* CHECK_HOSTNAMES */
/* convert %xx in url string to a character
* Allocate a new string and return a pointer to converted string */
}
}
-#if CHECK_HOSTNAMES
- if (Config.onoff.check_hostnames && strspn(host, valid_hostname_chars) != strlen(host)) {
+ if (Config.onoff.check_hostnames && strspn(host, Config.onoff.allow_underscore ? valid_hostname_chars_u : valid_hostname_chars) != strlen(host)) {
debug(23, 1) ("urlParse: Illegal character in hostname '%s'\n", host);
return NULL;
}
-#endif
#if DONT_DO_THIS_IT_BREAKS_SEMANTIC_TRANSPARENCY
/* remove trailing dots from hostnames */
while ((l = strlen(host)) > 0 && host[--l] == '.')