ph10 2005/01/13 10:09:36 GMT
Modified files:
exim-src ACKNOWLEDGMENTS
exim-src/src expand.c malware.c
Log:
(1) Get rid of compiler warnings (a) in expand.c on 64-bit systems (b) in
malware.c where there was a %hu and an int variable in sscanf(). (2)
Remove an email address from David Saez's email address in malware.c
(best not to have emails in public code these days). (3) Added a credit
to David S to ACKNOWLEDGMENTS.
Revision Changes Path
1.13 +1 -0 exim/exim-src/ACKNOWLEDGMENTS
1.11 +2 -2 exim/exim-src/src/expand.c
1.6 +48 -48 exim/exim-src/src/malware.c
Index: ACKNOWLEDGMENTS
===================================================================
RCS file: /home/cvs/exim/exim-src/ACKNOWLEDGMENTS,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ACKNOWLEDGMENTS 11 Jan 2005 15:17:52 -0000 1.12
+++ ACKNOWLEDGMENTS 13 Jan 2005 10:09:36 -0000 1.13
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-src/ACKNOWLEDGMENTS,v 1.12 2005/01/11 15:17:52 ph10 Exp $
+$Cambridge: exim/exim-src/ACKNOWLEDGMENTS,v 1.13 2005/01/13 10:09:36 ph10 Exp $
EXIM ACKNOWLEDGEMENTS
@@ -189,6 +189,7 @@
Alexander Sabourenkov Patch to add saslauthd daemon support
Patch for MySQL non-data queries
David Saez Suggested patch for $sender_hostname lookup if needed
+ Support for the clamd virus scanner
Peter Savitch Diagnosis of FPE bug when statvfs() fails on spool
Harald Schueler Patch for dn_expand() failure on truncated data
Heiko Schlichting Diagnosis of intermittent daemon crash bug
Index: expand.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/expand.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- expand.c 4 Jan 2005 10:00:42 -0000 1.10
+++ expand.c 13 Jan 2005 10:09:36 -0000 1.11
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/expand.c,v 1.10 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/expand.c,v 1.11 2005/01/13 10:09:36 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1379,14 +1379,14 @@
{
int inodes;
sprintf(CS var_buffer, "%d",
- receive_statvfs((BOOL)(var_table[middle].value), &inodes));
+ receive_statvfs(var_table[middle].value == (void *)TRUE, &inodes));
}
return var_buffer;
case vtype_pinodes:
{
int inodes;
- (void) receive_statvfs((BOOL)(var_table[middle].value), &inodes);
+ (void) receive_statvfs(var_table[middle].value == (void *)TRUE, &inodes);
sprintf(CS var_buffer, "%d", inodes);
}
return var_buffer;
Index: malware.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/malware.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- malware.c 11 Jan 2005 08:55:29 -0000 1.5
+++ malware.c 13 Jan 2005 10:09:36 -0000 1.6
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/malware.c,v 1.5 2005/01/11 08:55:29 tom Exp $ */
+/* $Cambridge: exim/exim-src/src/malware.c,v 1.6 2005/01/13 10:09:36 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -391,10 +391,10 @@
* DERR_CRC_ERROR, DERR_READSOCKET, DERR_WRITE_ERR
* and others are ignored */
if (drweb_s) {
- log_write(0, LOG_MAIN|LOG_PANIC,
- "malware acl condition: drweb: drweb daemon retcode 0x%x (%s)", drweb_rc, drweb_s);
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "malware acl condition: drweb: drweb daemon retcode 0x%x (%s)", drweb_rc, drweb_s);
close(sock);
- return DEFER;
+ return DEFER;
}
/* no virus found */
malware_name = NULL;
@@ -971,7 +971,7 @@
/* "clamd" scanner type ------------------------------------------------- */
- /* This code was contributed by David Saez <david@???> */
+ /* This code was contributed by David Saez */
else if (strcmpic(scanner_name,US"clamd") == 0) {
uschar *clamd_options;
uschar clamd_options_buffer[1024];
@@ -1086,7 +1086,7 @@
}
av_buffer2[bread] = '\0';
- if( sscanf(CS av_buffer2, "PORT %hu\n", &port) != 1 ) {
+ if( sscanf(CS av_buffer2, "PORT %u\n", &port) != 1 ) {
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: Expected port information from clamd, got '%s'", av_buffer2);
return DEFER;
@@ -1107,57 +1107,57 @@
return DEFER;
}
- snprintf(CS scanrequest, 1024,CS"%s/scan/%s/%s.eml",
+ snprintf(CS scanrequest, 1024,CS"%s/scan/%s/%s.eml",
spool_directory, message_id, message_id);
- /* calc file size */
- clam_fd = open(CS scanrequest, O_RDONLY);
- if (clam_fd == -1) {
- log_write(0, LOG_MAIN|LOG_PANIC,
- "malware acl condition: clamd: can't open spool file %s: %s",
- scanrequest, strerror(errno));
- return DEFER;
- }
+ /* calc file size */
+ clam_fd = open(CS scanrequest, O_RDONLY);
+ if (clam_fd == -1) {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "malware acl condition: clamd: can't open spool file %s: %s",
+ scanrequest, strerror(errno));
+ return DEFER;
+ }
fsize = lseek(clam_fd, 0, SEEK_END);
- if (fsize == -1) {
- log_write(0, LOG_MAIN|LOG_PANIC,
- "malware acl condition: clamd: can't seek spool file %s: %s",
- scanrequest, strerror(errno));
- return DEFER;
- }
- lseek(clam_fd, 0, SEEK_SET);
+ if (fsize == -1) {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "malware acl condition: clamd: can't seek spool file %s: %s",
+ scanrequest, strerror(errno));
+ return DEFER;
+ }
+ lseek(clam_fd, 0, SEEK_SET);
- clamav_fbuf = (uschar *) malloc (fsize);
+ clamav_fbuf = (uschar *) malloc (fsize);
if (!clamav_fbuf) {
close(sockData);
- close(clam_fd);
- log_write(0, LOG_MAIN|LOG_PANIC,
+ close(clam_fd);
+ log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: unable to allocate memory %u for file (%s)",
- fsize, scanrequest);
- return DEFER;
- }
+ fsize, scanrequest);
+ return DEFER;
+ }
- result = read (clam_fd, clamav_fbuf, fsize);
- if (result == -1) {
- close(sockData);
- close(clam_fd);
- free(clamav_fbuf);
- log_write(0, LOG_MAIN|LOG_PANIC,
- "malware acl condition: clamd: can't read spool file %s: %s",
- scanrequest, strerror(errno));
- return DEFER;
- }
- close(clam_fd);
-
- /* send file body to socket */
- if (send(sockData, clamav_fbuf, fsize, 0) < 0) {
- close(sockData);
- free(clamav_fbuf);
- log_write(0, LOG_MAIN|LOG_PANIC,
- "malware acl condition: clamd: unable to send file body to socket (%s:%u)", hostname, port);
- return DEFER;
- }
- free(clamav_fbuf);
+ result = read (clam_fd, clamav_fbuf, fsize);
+ if (result == -1) {
+ close(sockData);
+ close(clam_fd);
+ free(clamav_fbuf);
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "malware acl condition: clamd: can't read spool file %s: %s",
+ scanrequest, strerror(errno));
+ return DEFER;
+ }
+ close(clam_fd);
+
+ /* send file body to socket */
+ if (send(sockData, clamav_fbuf, fsize, 0) < 0) {
+ close(sockData);
+ free(clamav_fbuf);
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "malware acl condition: clamd: unable to send file body to socket (%s:%u)", hostname, port);
+ return DEFER;
+ }
+ free(clamav_fbuf);
close(sockData);
}
}