git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1202 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2004/12/19 22:52:29... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Sun Dec 19 13:51:20 GMT 2004 (njh) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/mbox.c: Further work on the non-parsing version. |
|
4 |
+ * clamav-milter: Fix compilation error in non SESSION mode |
|
5 |
+ |
|
1 | 6 |
Sun Dec 19 12:46:23 CET 2004 (tk) |
2 | 7 |
--------------------------------- |
3 | 8 |
* contrib/clamdwatch: updated to 0.7 |
... | ... |
@@ -26,6 +26,9 @@ |
26 | 26 |
* |
27 | 27 |
* Change History: |
28 | 28 |
* $Log: clamav-milter.c,v $ |
29 |
+ * Revision 1.164 2004/12/19 13:49:28 nigelhorne |
|
30 |
+ * Fix non SESSION compilation error |
|
31 |
+ * |
|
29 | 32 |
* Revision 1.163 2004/12/14 10:43:58 nigelhorne |
30 | 33 |
* Fix crash on BSD if DNS is incorrectly set up |
31 | 34 |
* |
... | ... |
@@ -500,11 +503,9 @@ |
500 | 500 |
* Revision 1.6 2003/09/28 16:37:23 nigelhorne |
501 | 501 |
* Added -f flag use MaxThreads if --max-children not set |
502 | 502 |
*/ |
503 |
-static char const rcsid[] = "$Id: clamav-milter.c,v 1.163 2004/12/14 10:43:58 nigelhorne Exp $"; |
|
504 |
- |
|
505 |
-#define CM_VERSION "0.80cc" |
|
503 |
+static char const rcsid[] = "$Id: clamav-milter.c,v 1.164 2004/12/19 13:49:28 nigelhorne Exp $"; |
|
506 | 504 |
|
507 |
-/*#define CONFDIR "/usr/local/etc"*/ |
|
505 |
+#define CM_VERSION "0.80dd" |
|
508 | 506 |
|
509 | 507 |
#if HAVE_CONFIG_H |
510 | 508 |
#include "clamav-config.h" |
... | ... |
@@ -1624,19 +1625,14 @@ main(int argc, char **argv) |
1624 | 1624 |
return EX_CONFIG; |
1625 | 1625 |
} |
1626 | 1626 |
|
1627 |
- if(internal) { |
|
1628 | 1627 |
#ifdef SESSION |
1628 |
+ if(internal) { |
|
1629 | 1629 |
if(clamav_versions == NULL) { |
1630 | 1630 |
clamav_versions = (char **)cli_malloc(sizeof(char *)); |
1631 | 1631 |
if(clamav_versions == NULL) |
1632 | 1632 |
return EX_TEMPFAIL; |
1633 | 1633 |
clamav_version = strdup(version); |
1634 | 1634 |
} |
1635 |
-#else |
|
1636 |
- strcpy(clamav_version, version); |
|
1637 |
-#endif |
|
1638 |
- |
|
1639 |
-#ifdef SESSION |
|
1640 | 1635 |
} else { |
1641 | 1636 |
clamav_versions = (char **)cli_malloc(max_children * sizeof(char *)); |
1642 | 1637 |
if(clamav_versions == NULL) |
... | ... |
@@ -1647,8 +1643,10 @@ main(int argc, char **argv) |
1647 | 1647 |
if(clamav_versions[i] == NULL) |
1648 | 1648 |
return EX_TEMPFAIL; |
1649 | 1649 |
} |
1650 |
-#endif |
|
1651 | 1650 |
} |
1651 |
+#else |
|
1652 |
+ strcpy(clamav_version, version); |
|
1653 |
+#endif |
|
1652 | 1654 |
|
1653 | 1655 |
if(((quarantine_dir == NULL) && localSocket) || internal) { |
1654 | 1656 |
/* set the temporary dir */ |
... | ... |
@@ -1833,7 +1831,9 @@ main(int argc, char **argv) |
1833 | 1833 |
|
1834 | 1834 |
signal(SIGPIPE, SIG_IGN); |
1835 | 1835 |
|
1836 |
+#ifdef SESSION |
|
1836 | 1837 |
pthread_mutex_lock(&version_mutex); |
1838 |
+#endif |
|
1837 | 1839 |
if(use_syslog) { |
1838 | 1840 |
syslog(LOG_INFO, _("Starting %s"), clamav_version); |
1839 | 1841 |
#ifdef CL_DEBUG |
... | ... |
@@ -1843,7 +1843,9 @@ main(int argc, char **argv) |
1843 | 1843 |
} |
1844 | 1844 |
|
1845 | 1845 |
cli_dbgmsg("Started: %s\n", clamav_version); |
1846 |
+#ifdef SESSION |
|
1846 | 1847 |
pthread_mutex_unlock(&version_mutex); |
1848 |
+#endif |
|
1847 | 1849 |
|
1848 | 1850 |
return smfi_main(); |
1849 | 1851 |
} |
... | ... |
@@ -2883,7 +2885,7 @@ clamfi_eom(SMFICTX *ctx) |
2883 | 2883 |
strncpy(hostname, j, |
2884 | 2884 |
sizeof(hostname) - 1); |
2885 | 2885 |
else |
2886 |
- strcpy(buf, _("Error determining host")); |
|
2886 |
+ strcpy(hostname, _("Error determining host")); |
|
2887 | 2887 |
} else if(strchr(hostname, '.') == NULL) { |
2888 | 2888 |
/* |
2889 | 2889 |
* Determine fully qualified name |
... | ... |
@@ -3362,7 +3364,7 @@ clamfi_free(struct privdata *privdata) |
3362 | 3362 |
if(session->status == CMDSOCKET_INUSE) { |
3363 | 3363 |
/* |
3364 | 3364 |
* Probably we've got here because |
3365 |
- * MaxStreamLength has been reached |
|
3365 |
+ * StreamMaxLength has been reached |
|
3366 | 3366 |
*/ |
3367 | 3367 |
#if 0 |
3368 | 3368 |
pthread_mutex_unlock(&sstatus_mutex); |
... | ... |
@@ -4705,10 +4707,14 @@ quit(void) |
4705 | 4705 |
|
4706 | 4706 |
quitting++; |
4707 | 4707 |
|
4708 |
+#ifdef SESSION |
|
4708 | 4709 |
pthread_mutex_lock(&version_mutex); |
4710 |
+#endif |
|
4709 | 4711 |
if(use_syslog) |
4710 | 4712 |
syslog(LOG_INFO, _("Stopping %s"), clamav_version); |
4713 |
+#ifdef SESSION |
|
4711 | 4714 |
pthread_mutex_unlock(&version_mutex); |
4715 |
+#endif |
|
4712 | 4716 |
|
4713 | 4717 |
if(internal) { |
4714 | 4718 |
if(root) { |
... | ... |
@@ -4858,9 +4864,13 @@ loadDatabase(void) |
4858 | 4858 |
if(use_syslog) { |
4859 | 4859 |
syslog(LOG_INFO, _("ClamAV: Protecting against %u viruses"), signatures); |
4860 | 4860 |
|
4861 |
+#ifdef SESSION |
|
4861 | 4862 |
pthread_mutex_lock(&version_mutex); |
4863 |
+#endif |
|
4862 | 4864 |
syslog(LOG_INFO, _("Loaded %s\n"), clamav_version); |
4865 |
+#ifdef SESSION |
|
4863 | 4866 |
pthread_mutex_unlock(&version_mutex); |
4867 |
+#endif |
|
4864 | 4868 |
} |
4865 | 4869 |
|
4866 | 4870 |
return cl_statinidir(dbdir, &dbstat); |