git-svn: trunk@4139
Török Edvin authored on 2008/08/25 21:50:09... | ... |
@@ -28,6 +28,6 @@ pkgconfig_DATA = libclamav.pc |
28 | 28 |
# don't complain that configuration files and databases are not removed, this is intended |
29 | 29 |
distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print |
30 | 30 |
DISTCLEANFILES = target.h |
31 |
-DISTCHECK_CONFIGURE_FLAGS=--enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-error=unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded" |
|
31 |
+DISTCHECK_CONFIGURE_FLAGS=--enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded" |
|
32 | 32 |
lcov: |
33 | 33 |
($(MAKE); cd unit_tests; $(MAKE) lcov) |
... | ... |
@@ -263,7 +263,7 @@ pkgconfig_DATA = libclamav.pc |
263 | 263 |
# don't complain that configuration files and databases are not removed, this is intended |
264 | 264 |
distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print |
265 | 265 |
DISTCLEANFILES = target.h |
266 |
-DISTCHECK_CONFIGURE_FLAGS = --enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-error=unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded" |
|
266 |
+DISTCHECK_CONFIGURE_FLAGS = --enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded" |
|
267 | 267 |
all: clamav-config.h |
268 | 268 |
$(MAKE) $(AM_MAKEFLAGS) all-recursive |
269 | 269 |
|
... | ... |
@@ -174,6 +174,7 @@ typedef unsigned int in_addr_t; |
174 | 174 |
|
175 | 175 |
#define VERSION_LENGTH 128 |
176 | 176 |
#define DEFAULT_TIMEOUT 120 |
177 |
+ |
|
177 | 178 |
#define NTRIES 5 /* How many times we try to connect to a clamd */ |
178 | 179 |
|
179 | 180 |
/*#define SESSION*/ |
... | ... |
@@ -233,10 +234,10 @@ static struct cidr_net { /* don't make this const because of -I flag */ |
233 | 233 |
uint32_t base; |
234 | 234 |
uint32_t mask; |
235 | 235 |
} localNets[] = { |
236 |
- /*{ PACKADDR(127, 0, 0, 0), MAKEMASK(8) }, /* 127.0.0.0/8 */ |
|
236 |
+ /*{ PACKADDR(127, 0, 0, 0), MAKEMASK(8) }, * 127.0.0.0/8 */ |
|
237 | 237 |
{ PACKADDR(192, 168, 0, 0), MAKEMASK(16) }, /* 192.168.0.0/16 - RFC3330 */ |
238 |
- /*{ PACKADDR(192, 18, 0, 0), MAKEMASK(15) }, /* 192.18.0.0/15 - RFC2544 */ |
|
239 |
- /*{ PACKADDR(192, 0, 2, 0), MAKEMASK(24) }, /* 192.0.2.0/24 - RFC3330 */ |
|
238 |
+ /*{ PACKADDR(192, 18, 0, 0), MAKEMASK(15) }, * 192.18.0.0/15 - RFC2544 */ |
|
239 |
+ /*{ PACKADDR(192, 0, 2, 0), MAKEMASK(24) }, * 192.0.2.0/24 - RFC3330 */ |
|
240 | 240 |
{ PACKADDR( 10, 0, 0, 0), MAKEMASK(8) }, /* 10.0.0.0/8 */ |
241 | 241 |
{ PACKADDR(172, 16, 0, 0), MAKEMASK(12) }, /* 172.16.0.0/12 */ |
242 | 242 |
{ PACKADDR(169, 254, 0, 0), MAKEMASK(16) }, /* 169.254.0.0/16 */ |
... | ... |
@@ -325,7 +326,11 @@ static sfsistat clamfi_abort(SMFICTX *ctx); |
325 | 325 |
static sfsistat clamfi_close(SMFICTX *ctx); |
326 | 326 |
static void clamfi_cleanup(SMFICTX *ctx); |
327 | 327 |
static void clamfi_free(struct privdata *privdata, int keep); |
328 |
+#ifdef __GNUC__ |
|
329 |
+static int clamfi_send(struct privdata *privdata, size_t len, const char *format, ...) __attribute__((format(printf, 3,4))); |
|
330 |
+#else |
|
328 | 331 |
static int clamfi_send(struct privdata *privdata, size_t len, const char *format, ...); |
332 |
+#endif |
|
329 | 333 |
static long clamd_recv(int sock, char *buf, size_t len); |
330 | 334 |
static off_t updateSigFile(void); |
331 | 335 |
static header_list_t header_list_new(void); |
... | ... |
@@ -447,7 +452,7 @@ static long streamMaxLength = -1; /* StreamMaxLength from clamd.conf */ |
447 | 447 |
static int logok = 0; /* |
448 | 448 |
* Add clean items to the log file |
449 | 449 |
*/ |
450 |
-static char *signature = N_("-- \nScanned by ClamAv - http://www.clamav.net\n"); |
|
450 |
+static const char *signature = N_("-- \nScanned by ClamAv - http://www.clamav.net\n"); |
|
451 | 451 |
static time_t signatureStamp; |
452 | 452 |
static char *templateFile; /* e-mail to be sent when virus detected */ |
453 | 453 |
static char *templateHeaders; /* headers to be added to the above */ |
... | ... |
@@ -598,7 +603,7 @@ res_state res_pool; |
598 | 598 |
uint8_t *res_pool_state; |
599 | 599 |
pthread_cond_t res_pool_cond = PTHREAD_COND_INITIALIZER; |
600 | 600 |
|
601 |
-int safe_res_query(const char *d, int c, int t, u_char *a, int l) { |
|
601 |
+static int safe_res_query(const char *d, int c, int t, u_char *a, int l) { |
|
602 | 602 |
int i = -1, ret; |
603 | 603 |
|
604 | 604 |
pthread_mutex_lock(&res_pool_mutex); |
... | ... |
@@ -626,7 +631,7 @@ int safe_res_query(const char *d, int c, int t, u_char *a, int l) { |
626 | 626 |
|
627 | 627 |
#else /* !HAVE_LRESOLV_R - non thread safe resolver (old bsd's) */ |
628 | 628 |
|
629 |
-int safe_res_query(const char *d, int c, int t, u_char *a, int l) { |
|
629 |
+static int safe_res_query(const char *d, int c, int t, u_char *a, int l) { |
|
630 | 630 |
int ret; |
631 | 631 |
pthread_mutex_lock(&res_pool_mutex); |
632 | 632 |
ret = res_query(d, c, t, a, l); |
... | ... |
@@ -695,10 +700,10 @@ help(void) |
695 | 695 |
puts(_("For bug reports, please refer to http://www.clamav.net/bugs")); |
696 | 696 |
} |
697 | 697 |
|
698 |
+extern char *optarg; |
|
698 | 699 |
int |
699 | 700 |
main(int argc, char **argv) |
700 | 701 |
{ |
701 |
- extern char *optarg; |
|
702 | 702 |
int i, Bflag = 0, server = 0; |
703 | 703 |
char *cfgfile = NULL; |
704 | 704 |
const char *wont_blacklist = NULL; |
... | ... |
@@ -1919,8 +1924,7 @@ main(int argc, char **argv) |
1919 | 1919 |
#endif |
1920 | 1920 |
} |
1921 | 1921 |
|
1922 |
- close(2); |
|
1923 |
- dup(1); |
|
1922 |
+ dup2(1, 2); |
|
1924 | 1923 |
|
1925 | 1924 |
#ifdef CL_DEBUG |
1926 | 1925 |
if(consolefd >= 0) |
... | ... |
@@ -2070,13 +2074,22 @@ main(int argc, char **argv) |
2070 | 2070 |
umask(old_umask); |
2071 | 2071 |
} else if(tmpdir) { |
2072 | 2072 |
if(rootdir == NULL) |
2073 |
- chdir(tmpdir); /* safety */ |
|
2073 |
+ if(chdir(tmpdir) < 0) { /* safety */ |
|
2074 |
+ perror(tmpdir); |
|
2075 |
+ logg("!chdir %s failed\n", tmpdir); |
|
2076 |
+ } |
|
2074 | 2077 |
} else |
2075 | 2078 |
if(rootdir == NULL) |
2076 | 2079 |
#ifdef P_tmpdir |
2077 |
- chdir(P_tmpdir); |
|
2080 |
+ if(chdir(P_tmpdir) < 0) { |
|
2081 |
+ perror(P_tmpdir); |
|
2082 |
+ logg("!chdir %s failed\n", P_tmpdir); |
|
2083 |
+ } |
|
2078 | 2084 |
#else |
2079 |
- chdir("/tmp"); |
|
2085 |
+ if(chdir("/tmp") < 0) { |
|
2086 |
+ perror("/tmp"); |
|
2087 |
+ logg("!chdir /tmp failed\n", P_tmpdir); |
|
2088 |
+ } |
|
2080 | 2089 |
#endif |
2081 | 2090 |
|
2082 | 2091 |
if(cfgopt(copt, "FixStaleSocket")->enabled) { |
... | ... |
@@ -2740,11 +2753,11 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) |
2740 | 2740 |
#ifdef HAVE_INET_NTOP |
2741 | 2741 |
switch(hostaddr->sa_family) { |
2742 | 2742 |
case AF_INET: |
2743 |
- remoteIP = (char *)inet_ntop(AF_INET, &((struct sockaddr_in *)(hostaddr))->sin_addr, ip, sizeof(ip)); |
|
2743 |
+ remoteIP = (const char *)inet_ntop(AF_INET, &((struct sockaddr_in *)(hostaddr))->sin_addr, ip, sizeof(ip)); |
|
2744 | 2744 |
break; |
2745 | 2745 |
#ifdef AF_INET6 |
2746 | 2746 |
case AF_INET6: |
2747 |
- remoteIP = (char *)inet_ntop(AF_INET6, &((struct sockaddr_in6 *)(hostaddr))->sin6_addr, ip, sizeof(ip)); |
|
2747 |
+ remoteIP = (const char *)inet_ntop(AF_INET6, &((struct sockaddr_in6 *)(hostaddr))->sin6_addr, ip, sizeof(ip)); |
|
2748 | 2748 |
break; |
2749 | 2749 |
#endif |
2750 | 2750 |
default: |
... | ... |
@@ -3333,7 +3346,7 @@ clamfi_body(SMFICTX *ctx, u_char *bodyp, size_t len) |
3333 | 3333 |
nbytes += clamfi_send(privdata, 1, ptr++); |
3334 | 3334 |
left--; |
3335 | 3335 |
} |
3336 |
- if(left < 6) { |
|
3336 |
+ if(left < 6 && left > 0) { |
|
3337 | 3337 |
nbytes += clamfi_send(privdata, left, ptr); |
3338 | 3338 |
break; |
3339 | 3339 |
} |
... | ... |
@@ -4030,7 +4043,7 @@ clamfi_eom(SMFICTX *ctx) |
4030 | 4030 |
* quarantine email |
4031 | 4031 |
*/ |
4032 | 4032 |
snprintf(reject, sizeof(reject) - 1, _("virus %s detected by ClamAV - http://www.clamav.net"), virusname); |
4033 |
- smfi_setreply(ctx, (char *)privdata->rejectCode, "5.7.1", reject); |
|
4033 |
+ smfi_setreply(ctx, (const char *)privdata->rejectCode, "5.7.1", reject); |
|
4034 | 4034 |
broadcast(mess); |
4035 | 4035 |
|
4036 | 4036 |
if(blacklist_time && privdata->ip[0]) { |
... | ... |
@@ -4269,7 +4282,6 @@ clamfi_send(struct privdata *privdata, size_t len, const char *format, ...) |
4269 | 4269 |
char output[BUFSIZ]; |
4270 | 4270 |
const char *ptr; |
4271 | 4271 |
int ret = 0; |
4272 |
- |
|
4273 | 4272 |
assert(format != NULL); |
4274 | 4273 |
|
4275 | 4274 |
if(len > 0) |
... | ... |
@@ -5823,7 +5835,6 @@ broadcast(const char *mess) |
5823 | 5823 |
static int |
5824 | 5824 |
loadDatabase(void) |
5825 | 5825 |
{ |
5826 |
- /*extern const char *cl_retdbdir(void); /* FIXME: should be included */ |
|
5827 | 5826 |
int ret; |
5828 | 5827 |
unsigned int signatures, dboptions; |
5829 | 5828 |
char *daily; |
... | ... |
@@ -5956,10 +5967,10 @@ sigsegv(int sig) |
5956 | 5956 |
smfi_stop(); |
5957 | 5957 |
} |
5958 | 5958 |
|
5959 |
+extern FILE *logg_fd; |
|
5959 | 5960 |
static void |
5960 | 5961 |
sighup(int sig) |
5961 | 5962 |
{ |
5962 |
- extern FILE *logg_fd; |
|
5963 | 5963 |
|
5964 | 5964 |
signal(SIGHUP, sighup); |
5965 | 5965 |
|
... | ... |
@@ -5969,8 +5980,7 @@ sighup(int sig) |
5969 | 5969 |
logg("SIGHUP caught: re-opening log file\n"); |
5970 | 5970 |
logg_close(); |
5971 | 5971 |
logg("*Log file re-opened\n"); |
5972 |
- close(2); |
|
5973 |
- dup(fileno(logg_fd)); |
|
5972 |
+ dup2(fileno(logg_fd), 2); |
|
5974 | 5973 |
} |
5975 | 5974 |
|
5976 | 5975 |
static void |
... | ... |
@@ -7003,6 +7013,5 @@ connect_error(int sock, const char *hostname) |
7003 | 7003 |
return -1; |
7004 | 7004 |
} |
7005 | 7005 |
#endif |
7006 |
- |
|
7007 | 7006 |
return 0; |
7008 | 7007 |
} |
... | ... |
@@ -884,7 +884,6 @@ MAINT |
884 | 884 |
LIBBZ2 |
885 | 885 |
LTLIBBZ2 |
886 | 886 |
LIBBZ2_PREFIX |
887 |
-sendmailprog |
|
888 | 887 |
HAVE_LIBGMP |
889 | 888 |
LIBGMP |
890 | 889 |
LTLIBGMP |
... | ... |
@@ -897,6 +896,7 @@ CLAMAV_MILTER_LIBS |
897 | 897 |
FRESHCLAM_LIBS |
898 | 898 |
TH_SAFE |
899 | 899 |
THREAD_LIBS |
900 |
+sendmailprog |
|
900 | 901 |
BUILD_CLAMD_TRUE |
901 | 902 |
BUILD_CLAMD_FALSE |
902 | 903 |
HAVE_MILTER_TRUE |
... | ... |
@@ -1550,14 +1550,14 @@ Optional Packages: |
1550 | 1550 |
--with-gnu-ld assume the C compiler uses GNU ld default=no |
1551 | 1551 |
--with-libbz2-prefix[=DIR] search for libbz2 in DIR/include and DIR/lib |
1552 | 1552 |
--without-libbz2-prefix don't search for libbz2 in includedir and libdir |
1553 |
- --with-sendmail=PATH specify location of Sendmail binary (default=auto find) |
|
1554 |
- --with-sendmail-version=VERSION specify version of Sendmail (default=auto find) |
|
1555 | 1553 |
--with-libgmp-prefix[=DIR] search for libgmp in DIR/include and DIR/lib |
1556 | 1554 |
--without-libgmp-prefix don't search for libgmp in includedir and libdir |
1557 | 1555 |
--with-iconv supports iconv() (default=auto) |
1558 | 1556 |
--with-user=uid name of the clamav user (default=clamav) |
1559 | 1557 |
--with-group=gid name of the clamav group (default=clamav) |
1560 | 1558 |
--with-dbdir=path path to virus database directory |
1559 |
+ --with-sendmail=PATH specify location of Sendmail binary (default=auto find) |
|
1560 |
+ --with-sendmail-version=VERSION specify version of Sendmail (default=auto find) |
|
1561 | 1561 |
--with-tcpwrappers support hosts.allow / hosts.deny (default=auto) |
1562 | 1562 |
|
1563 | 1563 |
Some influential environment variables: |
... | ... |
@@ -15425,7 +15425,7 @@ else |
15425 | 15425 |
#include <netinet/in.h> |
15426 | 15426 |
#include <arpa/nameser.h> |
15427 | 15427 |
#include <resolv.h> |
15428 |
-int main() { return (int)dn_expand; } |
|
15428 |
+int main() { return (long)dn_expand; } |
|
15429 | 15429 |
|
15430 | 15430 |
_ACEOF |
15431 | 15431 |
rm -f conftest.$ac_objext conftest$ac_exeext |
... | ... |
@@ -15479,7 +15479,7 @@ else |
15479 | 15479 |
#include <netinet/in.h> |
15480 | 15480 |
#include <arpa/nameser.h> |
15481 | 15481 |
#include <resolv.h> |
15482 |
-int main() { return (int)dn_expand; } |
|
15482 |
+int main() { return (long)dn_expand; } |
|
15483 | 15483 |
|
15484 | 15484 |
_ACEOF |
15485 | 15485 |
rm -f conftest.$ac_objext conftest$ac_exeext |
... | ... |
@@ -15548,7 +15548,7 @@ else |
15548 | 15548 |
#include <netinet/in.h> |
15549 | 15549 |
#include <arpa/nameser.h> |
15550 | 15550 |
#include <resolv.h> |
15551 |
-int main() { return (int)res_nquery; } |
|
15551 |
+int main() { return (long)res_nquery; } |
|
15552 | 15552 |
|
15553 | 15553 |
_ACEOF |
15554 | 15554 |
rm -f conftest.$ac_objext conftest$ac_exeext |
... | ... |
@@ -15755,108 +15755,6 @@ else |
15755 | 15755 |
fi |
15756 | 15756 |
|
15757 | 15757 |
|
15758 |
-if test "$have_milter" = "yes"; then |
|
15759 |
- sendmailprog=no |
|
15760 |
- |
|
15761 |
-# Check whether --with-sendmail was given. |
|
15762 |
-if test "${with_sendmail+set}" = set; then |
|
15763 |
- withval=$with_sendmail; sendmailprog=$with_sendmail |
|
15764 |
-else |
|
15765 |
- sendmailprog=no |
|
15766 |
-fi |
|
15767 |
- |
|
15768 |
- |
|
15769 |
- if test "$sendmailprog" = "no" ; then |
|
15770 |
- # Extract the first word of "sendmail", so it can be a program name with args. |
|
15771 |
-set dummy sendmail; ac_word=$2 |
|
15772 |
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5 |
|
15773 |
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } |
|
15774 |
-if test "${ac_cv_path_sendmailprog+set}" = set; then |
|
15775 |
- echo $ECHO_N "(cached) $ECHO_C" >&6 |
|
15776 |
-else |
|
15777 |
- case $sendmailprog in |
|
15778 |
- [\\/]* | ?:[\\/]*) |
|
15779 |
- ac_cv_path_sendmailprog="$sendmailprog" # Let the user override the test with a path. |
|
15780 |
- ;; |
|
15781 |
- *) |
|
15782 |
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
15783 |
-as_dummy="$PATH:/sbin:/usr/sbin:/usr/lib:/usr/libexec" |
|
15784 |
-for as_dir in $as_dummy |
|
15785 |
-do |
|
15786 |
- IFS=$as_save_IFS |
|
15787 |
- test -z "$as_dir" && as_dir=. |
|
15788 |
- for ac_exec_ext in '' $ac_executable_extensions; do |
|
15789 |
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then |
|
15790 |
- ac_cv_path_sendmailprog="$as_dir/$ac_word$ac_exec_ext" |
|
15791 |
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
15792 |
- break 2 |
|
15793 |
- fi |
|
15794 |
-done |
|
15795 |
-done |
|
15796 |
-IFS=$as_save_IFS |
|
15797 |
- |
|
15798 |
- test -z "$ac_cv_path_sendmailprog" && ac_cv_path_sendmailprog="no" |
|
15799 |
- ;; |
|
15800 |
-esac |
|
15801 |
-fi |
|
15802 |
-sendmailprog=$ac_cv_path_sendmailprog |
|
15803 |
-if test -n "$sendmailprog"; then |
|
15804 |
- { echo "$as_me:$LINENO: result: $sendmailprog" >&5 |
|
15805 |
-echo "${ECHO_T}$sendmailprog" >&6; } |
|
15806 |
-else |
|
15807 |
- { echo "$as_me:$LINENO: result: no" >&5 |
|
15808 |
-echo "${ECHO_T}no" >&6; } |
|
15809 |
-fi |
|
15810 |
- |
|
15811 |
- |
|
15812 |
- fi |
|
15813 |
- |
|
15814 |
- |
|
15815 |
-cat >>confdefs.h <<_ACEOF |
|
15816 |
-#define SENDMAIL_BIN "$sendmailprog" |
|
15817 |
-_ACEOF |
|
15818 |
- |
|
15819 |
- |
|
15820 |
- |
|
15821 |
-# Check whether --with-sendmail-version was given. |
|
15822 |
-if test "${with_sendmail_version+set}" = set; then |
|
15823 |
- withval=$with_sendmail_version; sendmailvers=$with_sendmail_version |
|
15824 |
-else |
|
15825 |
- sendmailvers=no |
|
15826 |
-fi |
|
15827 |
- |
|
15828 |
- |
|
15829 |
- if test "$sendmailvers" = "no" ; then |
|
15830 |
- sendmailver=`$sendmailprog -d0 < /dev/null | head -1 | awk '{print $2}'` |
|
15831 |
- fi |
|
15832 |
- |
|
15833 |
- if test -n "$sendmailver"; then |
|
15834 |
- sendmailver_a=`echo $sendmailver | awk -F. '{printf $1}'` |
|
15835 |
- sendmailver_b=`echo $sendmailver | awk -F. '{printf $2}'` |
|
15836 |
- sendmailver_c=`echo $sendmailver | awk -F. '{printf $3}'` |
|
15837 |
- |
|
15838 |
- |
|
15839 |
-cat >>confdefs.h <<_ACEOF |
|
15840 |
-#define SENDMAIL_VERSION_A $sendmailver_a |
|
15841 |
-_ACEOF |
|
15842 |
- |
|
15843 |
- |
|
15844 |
-cat >>confdefs.h <<_ACEOF |
|
15845 |
-#define SENDMAIL_VERSION_B $sendmailver_b |
|
15846 |
-_ACEOF |
|
15847 |
- |
|
15848 |
- |
|
15849 |
-cat >>confdefs.h <<_ACEOF |
|
15850 |
-#define SENDMAIL_VERSION_C $sendmailver_c |
|
15851 |
-_ACEOF |
|
15852 |
- |
|
15853 |
- fi |
|
15854 |
- if test "x$ac_cv_have_lresolv_r" != "xyes"; then |
|
15855 |
- { echo "$as_me:$LINENO: WARNING: ****** Your libresolv is not thread safe, SPF queries in clamav-milter will block" >&5 |
|
15856 |
-echo "$as_me: WARNING: ****** Your libresolv is not thread safe, SPF queries in clamav-milter will block" >&2;} |
|
15857 |
- fi |
|
15858 |
-fi |
|
15859 |
- |
|
15860 | 15758 |
# Check whether --enable-dsig was given. |
15861 | 15759 |
if test "${enable_dsig+set}" = set; then |
15862 | 15760 |
enableval=$enable_dsig; want_dsig=$enableval |
... | ... |
@@ -16523,7 +16421,7 @@ main () |
16523 | 16523 |
{ |
16524 | 16524 |
|
16525 | 16525 |
char** xin,**xout; |
16526 |
- unsigned il,ol; |
|
16526 |
+ unsigned long il,ol; |
|
16527 | 16527 |
int rc; |
16528 | 16528 |
iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); |
16529 | 16529 |
rc = iconv(iconv_struct,xin,&il,xout,&ol); |
... | ... |
@@ -17746,6 +17644,181 @@ done |
17746 | 17746 |
|
17747 | 17747 |
fi |
17748 | 17748 |
|
17749 |
+if test "$have_milter" = "yes"; then |
|
17750 |
+ sendmailprog=no |
|
17751 |
+ |
|
17752 |
+# Check whether --with-sendmail was given. |
|
17753 |
+if test "${with_sendmail+set}" = set; then |
|
17754 |
+ withval=$with_sendmail; sendmailprog=$with_sendmail |
|
17755 |
+else |
|
17756 |
+ sendmailprog=no |
|
17757 |
+fi |
|
17758 |
+ |
|
17759 |
+ |
|
17760 |
+ if test "$sendmailprog" = "no" ; then |
|
17761 |
+ # Extract the first word of "sendmail", so it can be a program name with args. |
|
17762 |
+set dummy sendmail; ac_word=$2 |
|
17763 |
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5 |
|
17764 |
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } |
|
17765 |
+if test "${ac_cv_path_sendmailprog+set}" = set; then |
|
17766 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6 |
|
17767 |
+else |
|
17768 |
+ case $sendmailprog in |
|
17769 |
+ [\\/]* | ?:[\\/]*) |
|
17770 |
+ ac_cv_path_sendmailprog="$sendmailprog" # Let the user override the test with a path. |
|
17771 |
+ ;; |
|
17772 |
+ *) |
|
17773 |
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
17774 |
+as_dummy="$PATH:/sbin:/usr/sbin:/usr/lib:/usr/libexec" |
|
17775 |
+for as_dir in $as_dummy |
|
17776 |
+do |
|
17777 |
+ IFS=$as_save_IFS |
|
17778 |
+ test -z "$as_dir" && as_dir=. |
|
17779 |
+ for ac_exec_ext in '' $ac_executable_extensions; do |
|
17780 |
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then |
|
17781 |
+ ac_cv_path_sendmailprog="$as_dir/$ac_word$ac_exec_ext" |
|
17782 |
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
17783 |
+ break 2 |
|
17784 |
+ fi |
|
17785 |
+done |
|
17786 |
+done |
|
17787 |
+IFS=$as_save_IFS |
|
17788 |
+ |
|
17789 |
+ test -z "$ac_cv_path_sendmailprog" && ac_cv_path_sendmailprog="no" |
|
17790 |
+ ;; |
|
17791 |
+esac |
|
17792 |
+fi |
|
17793 |
+sendmailprog=$ac_cv_path_sendmailprog |
|
17794 |
+if test -n "$sendmailprog"; then |
|
17795 |
+ { echo "$as_me:$LINENO: result: $sendmailprog" >&5 |
|
17796 |
+echo "${ECHO_T}$sendmailprog" >&6; } |
|
17797 |
+else |
|
17798 |
+ { echo "$as_me:$LINENO: result: no" >&5 |
|
17799 |
+echo "${ECHO_T}no" >&6; } |
|
17800 |
+fi |
|
17801 |
+ |
|
17802 |
+ |
|
17803 |
+ fi |
|
17804 |
+ |
|
17805 |
+ |
|
17806 |
+cat >>confdefs.h <<_ACEOF |
|
17807 |
+#define SENDMAIL_BIN "$sendmailprog" |
|
17808 |
+_ACEOF |
|
17809 |
+ |
|
17810 |
+ |
|
17811 |
+ |
|
17812 |
+# Check whether --with-sendmail-version was given. |
|
17813 |
+if test "${with_sendmail_version+set}" = set; then |
|
17814 |
+ withval=$with_sendmail_version; sendmailvers=$with_sendmail_version |
|
17815 |
+else |
|
17816 |
+ sendmailvers=no |
|
17817 |
+fi |
|
17818 |
+ |
|
17819 |
+ |
|
17820 |
+ if test "$sendmailvers" = "no" ; then |
|
17821 |
+ sendmailver=`$sendmailprog -d0 < /dev/null | head -1 | awk '{print $2}'` |
|
17822 |
+ fi |
|
17823 |
+ |
|
17824 |
+ if test -z "$sendmailver"; then |
|
17825 |
+ # example: postfix |
|
17826 |
+ LDFLAGS="$LDFLAGS $CLAMAV_MILTER_LIBS" |
|
17827 |
+ { echo "$as_me:$LINENO: checking for smfi_opensocket in -lmilter" >&5 |
|
17828 |
+echo $ECHO_N "checking for smfi_opensocket in -lmilter... $ECHO_C" >&6; } |
|
17829 |
+if test "${ac_cv_lib_milter_smfi_opensocket+set}" = set; then |
|
17830 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6 |
|
17831 |
+else |
|
17832 |
+ ac_check_lib_save_LIBS=$LIBS |
|
17833 |
+LIBS="-lmilter $LIBS" |
|
17834 |
+cat >conftest.$ac_ext <<_ACEOF |
|
17835 |
+/* confdefs.h. */ |
|
17836 |
+_ACEOF |
|
17837 |
+cat confdefs.h >>conftest.$ac_ext |
|
17838 |
+cat >>conftest.$ac_ext <<_ACEOF |
|
17839 |
+/* end confdefs.h. */ |
|
17840 |
+ |
|
17841 |
+/* Override any GCC internal prototype to avoid an error. |
|
17842 |
+ Use char because int might match the return type of a GCC |
|
17843 |
+ builtin and then its argument prototype would still apply. */ |
|
17844 |
+#ifdef __cplusplus |
|
17845 |
+extern "C" |
|
17846 |
+#endif |
|
17847 |
+char smfi_opensocket (); |
|
17848 |
+int |
|
17849 |
+main () |
|
17850 |
+{ |
|
17851 |
+return smfi_opensocket (); |
|
17852 |
+ ; |
|
17853 |
+ return 0; |
|
17854 |
+} |
|
17855 |
+_ACEOF |
|
17856 |
+rm -f conftest.$ac_objext conftest$ac_exeext |
|
17857 |
+if { (ac_try="$ac_link" |
|
17858 |
+case "(($ac_try" in |
|
17859 |
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; |
|
17860 |
+ *) ac_try_echo=$ac_try;; |
|
17861 |
+esac |
|
17862 |
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 |
|
17863 |
+ (eval "$ac_link") 2>conftest.er1 |
|
17864 |
+ ac_status=$? |
|
17865 |
+ grep -v '^ *+' conftest.er1 >conftest.err |
|
17866 |
+ rm -f conftest.er1 |
|
17867 |
+ cat conftest.err >&5 |
|
17868 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
17869 |
+ (exit $ac_status); } && { |
|
17870 |
+ test -z "$ac_c_werror_flag" || |
|
17871 |
+ test ! -s conftest.err |
|
17872 |
+ } && test -s conftest$ac_exeext && |
|
17873 |
+ $as_test_x conftest$ac_exeext; then |
|
17874 |
+ ac_cv_lib_milter_smfi_opensocket=yes |
|
17875 |
+else |
|
17876 |
+ echo "$as_me: failed program was:" >&5 |
|
17877 |
+sed 's/^/| /' conftest.$ac_ext >&5 |
|
17878 |
+ |
|
17879 |
+ ac_cv_lib_milter_smfi_opensocket=no |
|
17880 |
+fi |
|
17881 |
+ |
|
17882 |
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ |
|
17883 |
+ conftest$ac_exeext conftest.$ac_ext |
|
17884 |
+LIBS=$ac_check_lib_save_LIBS |
|
17885 |
+fi |
|
17886 |
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_milter_smfi_opensocket" >&5 |
|
17887 |
+echo "${ECHO_T}$ac_cv_lib_milter_smfi_opensocket" >&6; } |
|
17888 |
+if test $ac_cv_lib_milter_smfi_opensocket = yes; then |
|
17889 |
+ sendmailver="8.13.0" |
|
17890 |
+else |
|
17891 |
+ { echo "$as_me:$LINENO: WARNING: cannot determine sendmail version" >&5 |
|
17892 |
+echo "$as_me: WARNING: cannot determine sendmail version" >&2;} |
|
17893 |
+fi |
|
17894 |
+ |
|
17895 |
+ LDFLAGS="$save_LDFLAGS" |
|
17896 |
+ fi |
|
17897 |
+ if test -n "$sendmailver"; then |
|
17898 |
+ sendmailver_a=`echo $sendmailver | awk -F. '{printf $1}'` |
|
17899 |
+ sendmailver_b=`echo $sendmailver | awk -F. '{printf $2}'` |
|
17900 |
+ sendmailver_c=`echo $sendmailver | awk -F. '{printf $3}'` |
|
17901 |
+ |
|
17902 |
+ |
|
17903 |
+cat >>confdefs.h <<_ACEOF |
|
17904 |
+#define SENDMAIL_VERSION_A $sendmailver_a |
|
17905 |
+_ACEOF |
|
17906 |
+ |
|
17907 |
+ |
|
17908 |
+cat >>confdefs.h <<_ACEOF |
|
17909 |
+#define SENDMAIL_VERSION_B $sendmailver_b |
|
17910 |
+_ACEOF |
|
17911 |
+ |
|
17912 |
+ |
|
17913 |
+cat >>confdefs.h <<_ACEOF |
|
17914 |
+#define SENDMAIL_VERSION_C $sendmailver_c |
|
17915 |
+_ACEOF |
|
17916 |
+ |
|
17917 |
+ fi |
|
17918 |
+ if test "x$ac_cv_have_lresolv_r" != "xyes"; then |
|
17919 |
+ { echo "$as_me:$LINENO: WARNING: ****** Your libresolv is not thread safe, SPF queries in clamav-milter will block" >&5 |
|
17920 |
+echo "$as_me: WARNING: ****** Your libresolv is not thread safe, SPF queries in clamav-milter will block" >&2;} |
|
17921 |
+ fi |
|
17922 |
+fi |
|
17923 |
+ |
|
17749 | 17924 |
if test "$have_pthreads" = "yes"; then |
17750 | 17925 |
BUILD_CLAMD_TRUE= |
17751 | 17926 |
BUILD_CLAMD_FALSE='#' |
... | ... |
@@ -19536,14 +19609,15 @@ cat >>conftest.$ac_ext <<_ACEOF |
19536 | 19536 |
|
19537 | 19537 |
#define TEST "test" |
19538 | 19538 |
|
19539 |
-int send_fd(int s, int fd) |
|
19539 |
+static int send_fd(int s, int fd) |
|
19540 | 19540 |
{ |
19541 | 19541 |
struct msghdr msg; |
19542 | 19542 |
struct cmsghdr *cmsg; |
19543 | 19543 |
unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; |
19544 | 19544 |
struct iovec iov[1]; |
19545 |
+ char dummy[] = ""; |
|
19545 | 19546 |
|
19546 |
- iov[0].iov_base = ""; |
|
19547 |
+ iov[0].iov_base = dummy; |
|
19547 | 19548 |
iov[0].iov_len = 1; |
19548 | 19549 |
|
19549 | 19550 |
memset(&msg, 0, sizeof(msg)); |
... | ... |
@@ -19567,7 +19641,7 @@ int send_fd(int s, int fd) |
19567 | 19567 |
return 0; |
19568 | 19568 |
} |
19569 | 19569 |
|
19570 |
-int testfd(int desc) |
|
19570 |
+static int testfd(int desc) |
|
19571 | 19571 |
{ |
19572 | 19572 |
char buf[256]; |
19573 | 19573 |
if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { |
... | ... |
@@ -19577,7 +19651,7 @@ int testfd(int desc) |
19577 | 19577 |
return memcmp(buf, TEST, sizeof(TEST)); |
19578 | 19578 |
} |
19579 | 19579 |
|
19580 |
-int recv_fd(int desc) |
|
19580 |
+static int recv_fd(int desc) |
|
19581 | 19581 |
{ |
19582 | 19582 |
unsigned char buf[CMSG_SPACE(sizeof(int))]; |
19583 | 19583 |
struct msghdr msg; |
... | ... |
@@ -19643,7 +19717,10 @@ int main(void) |
19643 | 19643 |
waitpid(pid, NULL, 0); |
19644 | 19644 |
return 2; |
19645 | 19645 |
} |
19646 |
- write(pip[1], TEST, sizeof(TEST)); |
|
19646 |
+ if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { |
|
19647 |
+ close(pip[1]); |
|
19648 |
+ return -1; |
|
19649 |
+ } |
|
19647 | 19650 |
close(pip[1]); |
19648 | 19651 |
waitpid(pid, &status, 0); |
19649 | 19652 |
} |
... | ... |
@@ -19716,14 +19793,15 @@ cat >>conftest.$ac_ext <<_ACEOF |
19716 | 19716 |
|
19717 | 19717 |
#define TEST "test" |
19718 | 19718 |
|
19719 |
-int send_fd(int s, int fd) |
|
19719 |
+static int send_fd(int s, int fd) |
|
19720 | 19720 |
{ |
19721 | 19721 |
struct msghdr msg; |
19722 | 19722 |
struct cmsghdr *cmsg; |
19723 | 19723 |
unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; |
19724 | 19724 |
struct iovec iov[1]; |
19725 |
+ char dummy[] = ""; |
|
19725 | 19726 |
|
19726 |
- iov[0].iov_base = ""; |
|
19727 |
+ iov[0].iov_base = dummy; |
|
19727 | 19728 |
iov[0].iov_len = 1; |
19728 | 19729 |
|
19729 | 19730 |
memset(&msg, 0, sizeof(msg)); |
... | ... |
@@ -19747,7 +19825,7 @@ int send_fd(int s, int fd) |
19747 | 19747 |
return 0; |
19748 | 19748 |
} |
19749 | 19749 |
|
19750 |
-int testfd(int desc) |
|
19750 |
+static int testfd(int desc) |
|
19751 | 19751 |
{ |
19752 | 19752 |
char buf[256]; |
19753 | 19753 |
if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { |
... | ... |
@@ -19757,7 +19835,7 @@ int testfd(int desc) |
19757 | 19757 |
return memcmp(buf, TEST, sizeof(TEST)); |
19758 | 19758 |
} |
19759 | 19759 |
|
19760 |
-int recv_fd(int desc) |
|
19760 |
+static int recv_fd(int desc) |
|
19761 | 19761 |
{ |
19762 | 19762 |
unsigned char buf[CMSG_SPACE(sizeof(int))]; |
19763 | 19763 |
struct msghdr msg; |
... | ... |
@@ -19823,7 +19901,10 @@ int main(void) |
19823 | 19823 |
waitpid(pid, NULL, 0); |
19824 | 19824 |
return 2; |
19825 | 19825 |
} |
19826 |
- write(pip[1], TEST, sizeof(TEST)); |
|
19826 |
+ if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { |
|
19827 |
+ close(pip[1]); |
|
19828 |
+ return -1; |
|
19829 |
+ } |
|
19827 | 19830 |
close(pip[1]); |
19828 | 19831 |
waitpid(pid, &status, 0); |
19829 | 19832 |
} |
... | ... |
@@ -20777,7 +20858,6 @@ MAINT!$MAINT$ac_delim |
20777 | 20777 |
LIBBZ2!$LIBBZ2$ac_delim |
20778 | 20778 |
LTLIBBZ2!$LTLIBBZ2$ac_delim |
20779 | 20779 |
LIBBZ2_PREFIX!$LIBBZ2_PREFIX$ac_delim |
20780 |
-sendmailprog!$sendmailprog$ac_delim |
|
20781 | 20780 |
HAVE_LIBGMP!$HAVE_LIBGMP$ac_delim |
20782 | 20781 |
LIBGMP!$LIBGMP$ac_delim |
20783 | 20782 |
LTLIBGMP!$LTLIBGMP$ac_delim |
... | ... |
@@ -20790,6 +20870,7 @@ CLAMAV_MILTER_LIBS!$CLAMAV_MILTER_LIBS$ac_delim |
20790 | 20790 |
FRESHCLAM_LIBS!$FRESHCLAM_LIBS$ac_delim |
20791 | 20791 |
TH_SAFE!$TH_SAFE$ac_delim |
20792 | 20792 |
THREAD_LIBS!$THREAD_LIBS$ac_delim |
20793 |
+sendmailprog!$sendmailprog$ac_delim |
|
20793 | 20794 |
BUILD_CLAMD_TRUE!$BUILD_CLAMD_TRUE$ac_delim |
20794 | 20795 |
BUILD_CLAMD_FALSE!$BUILD_CLAMD_FALSE$ac_delim |
20795 | 20796 |
HAVE_MILTER_TRUE!$HAVE_MILTER_TRUE$ac_delim |
... | ... |
@@ -550,40 +550,6 @@ AC_ARG_ENABLE([milter], |
550 | 550 |
[ --enable-milter build clamav-milter], |
551 | 551 |
have_milter=$enableval, have_milter="no") |
552 | 552 |
|
553 |
-if test "$have_milter" = "yes"; then |
|
554 |
- sendmailprog=no |
|
555 |
- AC_ARG_WITH([sendmail], |
|
556 |
- [ --with-sendmail=PATH specify location of Sendmail binary (default=auto find)], |
|
557 |
- sendmailprog=$with_sendmail, sendmailprog=no) |
|
558 |
- |
|
559 |
- if test "$sendmailprog" = "no" ; then |
|
560 |
- AC_PATH_PROG([sendmailprog], sendmail, no, $PATH:/sbin:/usr/sbin:/usr/lib:/usr/libexec) |
|
561 |
- fi |
|
562 |
- |
|
563 |
- AC_DEFINE_UNQUOTED([SENDMAIL_BIN], "$sendmailprog", [location of Sendmail binary]) |
|
564 |
- |
|
565 |
- AC_ARG_WITH(sendmail-version, |
|
566 |
- [ --with-sendmail-version=VERSION specify version of Sendmail (default=auto find)], |
|
567 |
- sendmailvers=$with_sendmail_version, sendmailvers=no) |
|
568 |
- |
|
569 |
- if test "$sendmailvers" = "no" ; then |
|
570 |
- sendmailver=`$sendmailprog -d0 < /dev/null | head -1 | awk '{print $2}'` |
|
571 |
- fi |
|
572 |
- |
|
573 |
- if test -n "$sendmailver"; then |
|
574 |
- sendmailver_a=`echo $sendmailver | awk -F. '{printf $1}'` |
|
575 |
- sendmailver_b=`echo $sendmailver | awk -F. '{printf $2}'` |
|
576 |
- sendmailver_c=`echo $sendmailver | awk -F. '{printf $3}'` |
|
577 |
- |
|
578 |
- AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_A], $sendmailver_a, [major version of Sendmail]) |
|
579 |
- AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_B], $sendmailver_b, [minor version of Sendmail]) |
|
580 |
- AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_C], $sendmailver_c, [subversion of Sendmail]) |
|
581 |
- fi |
|
582 |
- if test "x$ac_cv_have_lresolv_r" != "xyes"; then |
|
583 |
- AC_MSG_WARN([****** Your libresolv is not thread safe, SPF queries in clamav-milter will block]) |
|
584 |
- fi |
|
585 |
-fi |
|
586 |
- |
|
587 | 553 |
AC_ARG_ENABLE([dsig], |
588 | 554 |
[ --disable-dsig disable support for digital signatures], |
589 | 555 |
want_dsig=$enableval, want_dsig="yes") |
... | ... |
@@ -625,7 +591,7 @@ if test "X$wiconv" != "Xno"; then |
625 | 625 |
#include <iconv.h> |
626 | 626 |
],[ |
627 | 627 |
char** xin,**xout; |
628 |
- unsigned il,ol; |
|
628 |
+ unsigned long il,ol; |
|
629 | 629 |
int rc; |
630 | 630 |
iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); |
631 | 631 |
rc = iconv(iconv_struct,xin,&il,xout,&ol); |
... | ... |
@@ -1030,6 +996,47 @@ if test "$have_milter" = "yes"; then |
1030 | 1030 |
]) |
1031 | 1031 |
fi |
1032 | 1032 |
|
1033 |
+if test "$have_milter" = "yes"; then |
|
1034 |
+ sendmailprog=no |
|
1035 |
+ AC_ARG_WITH([sendmail], |
|
1036 |
+ [ --with-sendmail=PATH specify location of Sendmail binary (default=auto find)], |
|
1037 |
+ sendmailprog=$with_sendmail, sendmailprog=no) |
|
1038 |
+ |
|
1039 |
+ if test "$sendmailprog" = "no" ; then |
|
1040 |
+ AC_PATH_PROG([sendmailprog], sendmail, no, $PATH:/sbin:/usr/sbin:/usr/lib:/usr/libexec) |
|
1041 |
+ fi |
|
1042 |
+ |
|
1043 |
+ AC_DEFINE_UNQUOTED([SENDMAIL_BIN], "$sendmailprog", [location of Sendmail binary]) |
|
1044 |
+ |
|
1045 |
+ AC_ARG_WITH(sendmail-version, |
|
1046 |
+ [ --with-sendmail-version=VERSION specify version of Sendmail (default=auto find)], |
|
1047 |
+ sendmailvers=$with_sendmail_version, sendmailvers=no) |
|
1048 |
+ |
|
1049 |
+ if test "$sendmailvers" = "no" ; then |
|
1050 |
+ sendmailver=`$sendmailprog -d0 < /dev/null | head -1 | awk '{print $2}'` |
|
1051 |
+ fi |
|
1052 |
+ |
|
1053 |
+ if test -z "$sendmailver"; then |
|
1054 |
+ # example: postfix |
|
1055 |
+ LDFLAGS="$LDFLAGS $CLAMAV_MILTER_LIBS" |
|
1056 |
+ AC_CHECK_LIB([milter],[smfi_opensocket],[sendmailver="8.13.0"], |
|
1057 |
+ [AC_MSG_WARN([cannot determine sendmail version])]) |
|
1058 |
+ LDFLAGS="$save_LDFLAGS" |
|
1059 |
+ fi |
|
1060 |
+ if test -n "$sendmailver"; then |
|
1061 |
+ sendmailver_a=`echo $sendmailver | awk -F. '{printf $1}'` |
|
1062 |
+ sendmailver_b=`echo $sendmailver | awk -F. '{printf $2}'` |
|
1063 |
+ sendmailver_c=`echo $sendmailver | awk -F. '{printf $3}'` |
|
1064 |
+ |
|
1065 |
+ AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_A], $sendmailver_a, [major version of Sendmail]) |
|
1066 |
+ AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_B], $sendmailver_b, [minor version of Sendmail]) |
|
1067 |
+ AC_DEFINE_UNQUOTED([SENDMAIL_VERSION_C], $sendmailver_c, [subversion of Sendmail]) |
|
1068 |
+ fi |
|
1069 |
+ if test "x$ac_cv_have_lresolv_r" != "xyes"; then |
|
1070 |
+ AC_MSG_WARN([****** Your libresolv is not thread safe, SPF queries in clamav-milter will block]) |
|
1071 |
+ fi |
|
1072 |
+fi |
|
1073 |
+ |
|
1033 | 1074 |
AM_CONDITIONAL([BUILD_CLAMD],[test "$have_pthreads" = "yes"]) |
1034 | 1075 |
AM_CONDITIONAL([HAVE_MILTER],[test "$have_milter" = "yes"]) |
1035 | 1076 |
AM_CONDITIONAL([ENABLE_UNRAR],[test "$want_unrar" = "yes"]) |
... | ... |
@@ -19,14 +19,15 @@ $1 |
19 | 19 |
|
20 | 20 |
#define TEST "test" |
21 | 21 |
|
22 |
-int send_fd(int s, int fd) |
|
22 |
+static int send_fd(int s, int fd) |
|
23 | 23 |
{ |
24 | 24 |
struct msghdr msg; |
25 | 25 |
struct cmsghdr *cmsg; |
26 | 26 |
unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; |
27 | 27 |
struct iovec iov[1]; |
28 |
+ char dummy[] = ""; |
|
28 | 29 |
|
29 |
- iov[0].iov_base = ""; |
|
30 |
+ iov[0].iov_base = dummy; |
|
30 | 31 |
iov[0].iov_len = 1; |
31 | 32 |
|
32 | 33 |
memset(&msg, 0, sizeof(msg)); |
... | ... |
@@ -50,7 +51,7 @@ int send_fd(int s, int fd) |
50 | 50 |
return 0; |
51 | 51 |
} |
52 | 52 |
|
53 |
-int testfd(int desc) |
|
53 |
+static int testfd(int desc) |
|
54 | 54 |
{ |
55 | 55 |
char buf[256]; |
56 | 56 |
if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { |
... | ... |
@@ -60,7 +61,7 @@ int testfd(int desc) |
60 | 60 |
return memcmp(buf, TEST, sizeof(TEST)); |
61 | 61 |
} |
62 | 62 |
|
63 |
-int recv_fd(int desc) |
|
63 |
+static int recv_fd(int desc) |
|
64 | 64 |
{ |
65 | 65 |
unsigned char buf[CMSG_SPACE(sizeof(int))]; |
66 | 66 |
struct msghdr msg; |
... | ... |
@@ -126,7 +127,10 @@ int main(void) |
126 | 126 |
waitpid(pid, NULL, 0); |
127 | 127 |
return 2; |
128 | 128 |
} |
129 |
- write(pip[1], TEST, sizeof(TEST)); |
|
129 |
+ if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { |
|
130 |
+ close(pip[1]); |
|
131 |
+ return -1; |
|
132 |
+ } |
|
130 | 133 |
close(pip[1]); |
131 | 134 |
waitpid(pid, &status, 0); |
132 | 135 |
} |
... | ... |
@@ -23,7 +23,7 @@ if test $want_dns = yes; then |
23 | 23 |
#include <netinet/in.h> |
24 | 24 |
#include <arpa/nameser.h> |
25 | 25 |
#include <resolv.h> |
26 |
-int main() { return (int)dn_expand; } |
|
26 |
+int main() { return (long)dn_expand; } |
|
27 | 27 |
], |
28 | 28 |
[ |
29 | 29 |
ac_cv_have_lresolv_std='yes' |
... | ... |
@@ -40,7 +40,7 @@ int main() { return (int)dn_expand; } |
40 | 40 |
#include <netinet/in.h> |
41 | 41 |
#include <arpa/nameser.h> |
42 | 42 |
#include <resolv.h> |
43 |
-int main() { return (int)dn_expand; } |
|
43 |
+int main() { return (long)dn_expand; } |
|
44 | 44 |
], |
45 | 45 |
[ |
46 | 46 |
ac_cv_have_lresolv_lresolv='yes' |
... | ... |
@@ -69,7 +69,7 @@ int main() { return (int)dn_expand; } |
69 | 69 |
#include <netinet/in.h> |
70 | 70 |
#include <arpa/nameser.h> |
71 | 71 |
#include <resolv.h> |
72 |
-int main() { return (int)res_nquery; } |
|
72 |
+int main() { return (long)res_nquery; } |
|
73 | 73 |
], |
74 | 74 |
[ |
75 | 75 |
ac_cv_have_lresolv_r='yes' |