Subject: ClamAV Milter support
To: None <tech-pkg@netbsd.org>
From: Mike M. Volokhov <mishka@apk.od.ua>
List: tech-pkg
Date: 01/27/2004 13:06:23
Greetings!
Currently mail/clamav is disallowed to build clamav-milter
(USE_MILTER=YES). From CVS log message I found:
----------------------------
revision 1.5
date: 2003/09/28 23:39:24; author: chris; state: Exp; lines: +14 -4
Update clamav so that milter support is optional.
However currently milter support is disabled, as it requires strerror_r to
be available, which it isn't on -current.
Note this required the fixing of the milter tests in the configure.in file.
It seemed if you used --disable-milter and the .h file was in the include
path, eg on -current it's in /usr/include/libmilter it was found and used.
We now have a want_milter for the --enable/disable-milter, which will
trigger the tests to setup have_milter.
Once I've sorted out the strerror_r problem in -current I'll enable the
milter support (or if someone tells me it works with pth)
Bump PKGREVISION.
----------------------------
It is possible to use the patch as follows to avoid strerror_r usage?
--- clamav-milter/clamav-milter.c Tue May 30 02:17:00 2000
+++ clamav-milter/clamav-milter.c Tue Jan 27 12:50:06 2004
@@ -631,8 +631,14 @@
rc = pthread_cond_timedwait(&n_children_cond, &n_children_mutex, &timeout);
if(rc != 0) {
char message[64], buf[64];
-
+#ifdef NO_STRERROR_R
+ char *errp;
+ errp = strerror(rc);
+ strncpy(buf, errp, 63);
+ buf[63] = '\0';
+#else
strerror_r(rc, buf, sizeof(buf));
+#endif
snprintf(message, sizeof(message), "pthread_cond_timedwait: %s", buf);
if(use_syslog)
syslog(LOG_ERR, message);
@@ -774,8 +780,14 @@
/* 0.4 - use better error message */
if(use_syslog) {
char buf[64];
-
+#ifdef NO_STRERROR_R
+ char *errp;
+ errp = strerror(rc);
+ strncpy(buf, errp, 63);
+ buf[63] = '\0';
+#else
strerror_r(rc, buf, sizeof(buf));
+#endif
syslog(LOG_ERR, "Failed to connect to port %d given by clamd: %s", port, buf);
}
Any comments would be appreciated.
--
Mishka.