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.
-$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.12 2005/01/11 15:17:52 ph10 Exp $
+$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.13 2005/01/13 10:09:36 ph10 Exp $
Alexander Sabourenkov Patch to add saslauthd daemon support
Patch for MySQL non-data queries
David Saez Suggested patch for $sender_hostname lookup if needed
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
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
-/* $Cambridge: exim/src/src/expand.c,v 1.10 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.11 2005/01/13 10:09:36 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/*************************************************
* Exim - an Internet mail transport agent *
{
int inodes;
sprintf(CS var_buffer, "%d",
{
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;
}
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;
sprintf(CS var_buffer, "%d", inodes);
}
return var_buffer;
-/* $Cambridge: exim/src/src/malware.c,v 1.5 2005/01/11 08:55:29 tom Exp $ */
+/* $Cambridge: exim/src/src/malware.c,v 1.6 2005/01/13 10:09:36 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/*************************************************
* Exim - an Internet mail transport agent *
* DERR_CRC_ERROR, DERR_READSOCKET, DERR_WRITE_ERR
* and others are ignored */
if (drweb_s) {
* 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);
}
/* no virus found */
malware_name = NULL;
}
/* no virus found */
malware_name = NULL;
/* "clamd" scanner type ------------------------------------------------- */
/* "clamd" scanner type ------------------------------------------------- */
- /* This code was contributed by David Saez <david@ols.es> */
+ /* This code was contributed by David Saez */
else if (strcmpic(scanner_name,US"clamd") == 0) {
uschar *clamd_options;
uschar clamd_options_buffer[1024];
else if (strcmpic(scanner_name,US"clamd") == 0) {
uschar *clamd_options;
uschar clamd_options_buffer[1024];
}
av_buffer2[bread] = '\0';
}
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;
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: Expected port information from clamd, got '%s'", av_buffer2);
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);
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);
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);
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)",
"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);
+ 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);
+ /* 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);