git-svn: trunk@2249
Tomasz Kojm authored on 2006/09/14 00:51:14... | ... |
@@ -1,3 +1,10 @@ |
1 |
+Wed Sep 13 17:46:06 CEST 2006 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * freshclam/dns.c: try to handle broken dns servers (such as in SpeedTouch |
|
4 |
+ 510), the workaround must be enabled during installation |
|
5 |
+ Patch from Arnold Metselaar <arnold.metselaar*planet.nl> |
|
6 |
+ * configure: new --enable-dns-fix switch |
|
7 |
+ |
|
1 | 8 |
Wed Sep 13 00:50:40 CEST 2006 (tk) |
2 | 9 |
---------------------------------- |
3 | 10 |
* shared/cfgparser.c: fix error path leaks, patch from Mark Pizzolato |
... | ... |
@@ -1482,6 +1482,7 @@ Optional Features: |
1482 | 1482 |
--disable-clamav disable test for clamav user/group |
1483 | 1483 |
--enable-debug enable debug code |
1484 | 1484 |
--enable-no-cache use "Cache-Control: no-cache" in freshclam |
1485 |
+ --enable-dns-fix enable workaround for broken DNS servers (as in SpeedTouch 510) |
|
1485 | 1486 |
--enable-experimental enable experimental code |
1486 | 1487 |
--enable-bigstack increase thread stack size |
1487 | 1488 |
--disable-gethostbyname_r disable support for gethostbyname_r |
... | ... |
@@ -5882,7 +5883,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes |
5882 | 5882 |
case $host in |
5883 | 5883 |
*-*-irix6*) |
5884 | 5884 |
# Find out which ABI we are using. |
5885 |
- echo '#line 5885 "configure"' > conftest.$ac_ext |
|
5885 |
+ echo '#line 5886 "configure"' > conftest.$ac_ext |
|
5886 | 5886 |
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
5887 | 5887 |
(eval $ac_compile) 2>&5 |
5888 | 5888 |
ac_status=$? |
... | ... |
@@ -6515,7 +6516,7 @@ chmod -w . |
6515 | 6515 |
save_CFLAGS="$CFLAGS" |
6516 | 6516 |
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" |
6517 | 6517 |
compiler_c_o=no |
6518 |
-if { (eval echo configure:6518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then |
|
6518 |
+if { (eval echo configure:6519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then |
|
6519 | 6519 |
# The compiler can only warn and ignore the option if not recognized |
6520 | 6520 |
# So say no if there are warnings |
6521 | 6521 |
if test -s out/conftest.err; then |
... | ... |
@@ -8551,7 +8552,7 @@ else |
8551 | 8551 |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
8552 | 8552 |
lt_status=$lt_dlunknown |
8553 | 8553 |
cat > conftest.$ac_ext <<EOF |
8554 |
-#line 8554 "configure" |
|
8554 |
+#line 8555 "configure" |
|
8555 | 8555 |
#include "confdefs.h" |
8556 | 8556 |
|
8557 | 8557 |
#if HAVE_DLFCN_H |
... | ... |
@@ -8649,7 +8650,7 @@ else |
8649 | 8649 |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
8650 | 8650 |
lt_status=$lt_dlunknown |
8651 | 8651 |
cat > conftest.$ac_ext <<EOF |
8652 |
-#line 8652 "configure" |
|
8652 |
+#line 8653 "configure" |
|
8653 | 8653 |
#include "confdefs.h" |
8654 | 8654 |
|
8655 | 8655 |
#if HAVE_DLFCN_H |
... | ... |
@@ -13174,6 +13175,22 @@ _ACEOF |
13174 | 13174 |
|
13175 | 13175 |
fi |
13176 | 13176 |
|
13177 |
+# Check whether --enable-dns-fix was given. |
|
13178 |
+if test "${enable_dns_fix+set}" = set; then |
|
13179 |
+ enableval=$enable_dns_fix; enable_dnsfix=$enableval |
|
13180 |
+else |
|
13181 |
+ enable_dnsfix="no" |
|
13182 |
+fi |
|
13183 |
+ |
|
13184 |
+ |
|
13185 |
+if test "$enable_dnsfix" = "yes"; then |
|
13186 |
+ |
|
13187 |
+cat >>confdefs.h <<\_ACEOF |
|
13188 |
+#define FRESHCLAM_DNS_FIX 1 |
|
13189 |
+_ACEOF |
|
13190 |
+ |
|
13191 |
+fi |
|
13192 |
+ |
|
13177 | 13193 |
# Check whether --enable-experimental was given. |
13178 | 13194 |
if test "${enable_experimental+set}" = set; then |
13179 | 13195 |
enableval=$enable_experimental; enable_experimental=$enableval |
... | ... |
@@ -300,6 +300,14 @@ if test "$enable_nocache" = "yes"; then |
300 | 300 |
AC_DEFINE(FRESHCLAM_NO_CACHE,1,[use "Cache-Control: no-cache" in freshclam]) |
301 | 301 |
fi |
302 | 302 |
|
303 |
+AC_ARG_ENABLE(dns-fix, |
|
304 |
+[ --enable-dns-fix enable workaround for broken DNS servers (as in SpeedTouch 510)], |
|
305 |
+enable_dnsfix=$enableval, enable_dnsfix="no") |
|
306 |
+ |
|
307 |
+if test "$enable_dnsfix" = "yes"; then |
|
308 |
+ AC_DEFINE(FRESHCLAM_DNS_FIX,1,[enable workaround for broken DNS servers]) |
|
309 |
+fi |
|
310 |
+ |
|
303 | 311 |
AC_ARG_ENABLE(experimental, |
304 | 312 |
[ --enable-experimental enable experimental code], |
305 | 313 |
enable_experimental=$enableval, enable_experimental="no") |
... | ... |
@@ -44,7 +44,7 @@ |
44 | 44 |
char *txtquery(const char *domain, unsigned int *ttl) |
45 | 45 |
{ |
46 | 46 |
unsigned char answer[PACKETSZ], host[128], *pt, *txt; |
47 |
- int len, exp, cttl, size, txtlen, type; |
|
47 |
+ int len, exp, cttl, size, txtlen, type, qtype; |
|
48 | 48 |
|
49 | 49 |
|
50 | 50 |
if(res_init() < 0) { |
... | ... |
@@ -55,9 +55,24 @@ char *txtquery(const char *domain, unsigned int *ttl) |
55 | 55 |
logg("*Querying %s\n", domain); |
56 | 56 |
|
57 | 57 |
memset(answer, 0, PACKETSZ); |
58 |
- if((len = res_query(domain, C_IN, T_TXT, answer, PACKETSZ)) < 0) { |
|
58 |
+ qtype = T_TXT; |
|
59 |
+ if((len = res_query(domain, C_IN, qtype, answer, PACKETSZ)) < 0) { |
|
60 |
+#ifdef FRESHCLAM_DNS_FIX |
|
61 |
+ /* The DNS server in the SpeedTouch Alcatel 510 modem can't |
|
62 |
+ * handle a TXT-query, but it can resolve an ANY-query to a |
|
63 |
+ * TXT-record, so we try an ANY-query now. The thing we try |
|
64 |
+ * to resolve normally only has a TXT-record anyway. |
|
65 |
+ */ |
|
66 |
+ memset(answer, 0, PACKETSZ); |
|
67 |
+ qtype=T_ANY; |
|
68 |
+ if((len = res_query(domain, C_IN, qtype, answer, PACKETSZ)) < 0) { |
|
69 |
+ logg("^Can't query %s\n", domain); |
|
70 |
+ return NULL; |
|
71 |
+ } |
|
72 |
+#else |
|
59 | 73 |
logg("^Can't query %s\n", domain); |
60 | 74 |
return NULL; |
75 |
+#endif |
|
61 | 76 |
} |
62 | 77 |
|
63 | 78 |
pt = answer + sizeof(HEADER); |
... | ... |
@@ -70,7 +85,7 @@ char *txtquery(const char *domain, unsigned int *ttl) |
70 | 70 |
pt += exp; |
71 | 71 |
|
72 | 72 |
GETSHORT(type, pt); |
73 |
- if(type != T_TXT) { |
|
73 |
+ if(type != qtype) { |
|
74 | 74 |
logg("^Broken DNS reply.\n"); |
75 | 75 |
return NULL; |
76 | 76 |
} |