-/* $Cambridge: exim/src/src/malware.c,v 1.21 2010/06/07 00:12:42 pdp Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
int malware(uschar **listptr) {
uschar scan_filename[1024];
BOOL fits;
+ int ret;
fits = string_format(scan_filename, sizeof(scan_filename),
CS"%s/scan/%s/%s.eml", spool_directory, message_id, message_id);
if (!fits)
{
+ av_failed = TRUE;
log_write(0, LOG_MAIN|LOG_PANIC,
"malware filename does not fit in buffer [malware()]");
return DEFER;
}
- return malware_internal(listptr, scan_filename, FALSE);
+ ret = malware_internal(listptr, scan_filename, FALSE);
+ if (ret == DEFER) av_failed = TRUE;
+
+ return ret;
}
}
}
else {
- char *drweb_s = NULL;
+ const char *drweb_s = NULL;
if (drweb_rc & DERR_READ_ERR) drweb_s = "read error";
if (drweb_rc & DERR_NOMEMORY) drweb_s = "no memory";
static int mksd_scan_packed(int sock, uschar *scan_filename)
{
struct iovec iov[3];
- char *cmd = "MSQ\n";
+ const char *cmd = "MSQ\n";
uschar av_buffer[1024];
- iov[0].iov_base = cmd;
+ iov[0].iov_base = (void *) cmd;
iov[0].iov_len = 3;
iov[1].iov_base = CS scan_filename;
iov[1].iov_len = Ustrlen(scan_filename);
- iov[2].iov_base = cmd + 3;
+ iov[2].iov_base = (void *) (cmd + 3);
iov[2].iov_len = 1;
if (mksd_writev (sock, iov, 3) < 0)