# HG changeset patch # User Carl Byington # Date 1230484525 28800 # Node ID da9e7f1c8160a48cb0c662025d48fcb6df46ca84 # Parent b2a7ca39871274c90a95bf8768744264541f406a fix unsigned signed compare, back to mixed -lresolv and libresolv.a with auto requires diff -r b2a7ca398712 -r da9e7f1c8160 dnsbl.spec.in --- a/dnsbl.spec.in Sun Dec 28 08:34:14 2008 -0800 +++ b/dnsbl.spec.in Sun Dec 28 09:15:25 2008 -0800 @@ -9,7 +9,6 @@ Source: http://www.five-ten-sg.com/%{name}/packages/%{name}-%{version}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) URL: http://www.five-ten-sg.com/%{name}/ -AutoReqProv: no Requires(pre): /usr/sbin/useradd Requires(pre): /usr/bin/getent @@ -20,7 +19,6 @@ Requires: sendmail >= 8.12.1 Requires: sendmail-cf Requires: spamassassin -Requires: libc.so.6, libgcc_s.so.1, libm.so.6, libpthread.so.0, libstdc++.so.6 %description diff -r b2a7ca398712 -r da9e7f1c8160 src/Makefile.am --- a/src/Makefile.am Sun Dec 28 08:34:14 2008 -0800 +++ b/src/Makefile.am Sun Dec 28 09:15:25 2008 -0800 @@ -7,7 +7,7 @@ # the library search path. dnsbl_LDFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -dnsbl_LDADD = $(all_libraries) -lmilter /usr/lib/libresolv.a +dnsbl_LDADD = $(all_libraries) -lmilter -lresolv /usr/lib/libresolv.a # default compile flags dnsbl_CXXFLAGS = $(PTHREAD_CFLAGS) diff -r b2a7ca398712 -r da9e7f1c8160 src/dnsbl.cpp --- a/src/dnsbl.cpp Sun Dec 28 08:34:14 2008 -0800 +++ b/src/dnsbl.cpp Sun Dec 28 09:15:25 2008 -0800 @@ -532,8 +532,9 @@ snprintf(text, sizeof(text), "process_resolver_requests() has a question %s", question); my_syslog(text); #endif - glom.length = res_search(question, ns_c_in, ns_t_a, glom.answer, sizeof(glom.answer)); - if (glom.length < 0) glom.length = 0; // represent all errors as zero length answers + int res_result = res_search(question, ns_c_in, ns_t_a, glom.answer, sizeof(glom.answer)); + if (res_result < 0) glom.length = 0; // represent all errors as zero length answers + else glom.length = (size_t)res_result; #else glom.length = sizeof(glom.answer); glom.answer = 0; @@ -611,7 +612,7 @@ snprintf(text, sizeof(text), "dns_interface() wrote question %s and has answer length %d", question, glom.length); my_syslog(text); #endif - if ((glom.length < 0) || (glom.length > sizeof(glom.answer))) { + if ((glom.length == 0) || (glom.length > sizeof(glom.answer))) { priv.err = true; return 0; // cannot process overlarge answers } @@ -622,7 +623,6 @@ // stepping on each other while parsing the dns answer. int ret_address = 0; pthread_mutex_lock(&resolve_mutex); - if (glom.length > 0) { // parse the answer ns_msg handle; ns_rr rr; @@ -682,7 +682,6 @@ } } } - } pthread_mutex_unlock(&resolve_mutex); #ifdef RESOLVER_DEBUG snprintf(text, sizeof(text), "dns_interface() found ip %d", ret_address); diff -r b2a7ca398712 -r da9e7f1c8160 src/includes.h --- a/src/includes.h Sun Dec 28 08:34:14 2008 -0800 +++ b/src/includes.h Sun Dec 28 09:15:25 2008 -0800 @@ -9,7 +9,7 @@ #define VERIFY_DEBUG 1 #define RESOLVER_DEBUG 1 #undef VERIFY_DEBUG -//#undef RESOLVER_DEBUG +#undef RESOLVER_DEBUG #ifdef HAVE_CONFIG_H #include "config.h"