int ret;
scan_filename = string_sprintf("%s/scan/%s/%s.eml",
- spool_directory, message_id, message_id);
+ spool_directory, message_id, message_id);
ret = malware_internal(listptr, scan_filename, FALSE);
if (ret == DEFER) av_failed = TRUE;
static struct scan
{
scanner_t scancode;
- const char * name;
- const char * options_default;
+ const uschar * name;
+ const uschar * options_default;
} m_scans[] =
{
- { M_FPROTD, "f-protd", CUS"localhost 10200-10204" },
- { M_DRWEB, "drweb", CUS"/usr/local/drweb/run/drwebd.sock" },
- { M_AVES, "aveserver", CUS"/var/run/aveserver" },
- { M_FSEC, "fsecure", CUS"/var/run/.fsav" },
- { M_KAVD, "kavdaemon", CUS"/var/run/AvpCtl" },
- { M_CMDL, "cmdline", NULL },
- { M_SOPHIE, "sophie", CUS"/var/run/sophie" },
- { M_CLAMD, "clamd", CUS"/tmp/clamd" },
- { M_SOCK, "sock", CUS"/tmp/malware.sock" },
- { M_MKSD, "mksd", NULL },
+ { M_FPROTD, US"f-protd", US"localhost 10200-10204" },
+ { M_DRWEB, US"drweb", US"/usr/local/drweb/run/drwebd.sock" },
+ { M_AVES, US"aveserver", US"/var/run/aveserver" },
+ { M_FSEC, US"fsecure", US"/var/run/.fsav" },
+ { M_KAVD, US"kavdaemon", US"/var/run/AvpCtl" },
+ { M_CMDL, US"cmdline", NULL },
+ { M_SOPHIE, US"sophie", US"/var/run/sophie" },
+ { M_CLAMD, US"clamd", US"/tmp/clamd" },
+ { M_SOCK, US"sock", US"/tmp/malware.sock" },
+ { M_MKSD, US"mksd", NULL },
{ -1, NULL, NULL } /* end-marker */
};
/* none of our current scanners need the mbox
file as a stream, so we can close it right away */
- /*XXX drweb and clamd do!! */
(void)fclose(mbox_file);
/* extract the malware regex to match against from the option list */
- if (!(malware_regex = string_nextinlist(&list, &sep, NULL, 0))) {
+ if (!(malware_regex = string_nextinlist(&list, &sep, NULL, 0)))
+ return FAIL; /* empty means "don't match anything" */
- /* parse 1st option */
+ /* parse 1st option */
if ( (strcmpic(malware_regex,US"false") == 0) ||
- (Ustrcmp(malware_regex,"0") == 0) )
- return FAIL; /* explicitly no matching */
-
- /* special cases (match anything except empty) */
- if ( (strcmpic(malware_regex,US"true") == 0) ||
- (Ustrcmp(malware_regex,"*") == 0) ||
- (Ustrcmp(malware_regex,"1") == 0) )
- malware_regex = malware_regex_default;
- }
- else /* empty means "don't match anything" */
- return FAIL;
+ (Ustrcmp(malware_regex,"0") == 0) )
+ return FAIL; /* explicitly no matching */
+
+ /* special cases (match anything except empty) */
+ if ( (strcmpic(malware_regex,US"true") == 0) ||
+ (Ustrcmp(malware_regex,"*") == 0) ||
+ (Ustrcmp(malware_regex,"1") == 0) )
+ malware_regex = malware_regex_default;
/* Reset sep that is set by previous string_nextinlist() call */
sep = 0;
/* wait for result */
if ((bread = recv(sock, &drweb_rc, sizeof(drweb_rc), 0) != sizeof(drweb_rc))) {
(void)close(sock);
- return drweb_errlog_defer("unable to read return code");
+ return drweb_errlog_defer(US"unable to read return code");
}
drweb_rc = ntohl(drweb_rc);
int report_flag = 0;
/* setup default virus name */
- malware_name = "unknown";
+ malware_name = US"unknown";
report_flag = tmpbuf[ test_byte_order() == LITTLE_MY_ENDIAN ? 1 : 0 ];
/* extract host and port part */
if( sscanf(CS address, "%" MAX_CLAMD_ADDRESS_LENGTH_S "s %u",
this_clamd->tcp_addr, &(this_clamd->tcp_port)) != 2 ) {
- clmd_errlog(string_sprintf(US"invalid address '%s'", address));
+ clmd_errlog(string_sprintf("invalid address '%s'", address));
continue;
}
clamd_address_vector[num_servers] = this_clamd;
num_servers++;
if (num_servers >= MAX_CLAMD_SERVERS) {
- clmd_errlog("More than " MAX_CLAMD_SERVERS_S " clamd servers "
+ clmd_errlog(US"More than " MAX_CLAMD_SERVERS_S " clamd servers "
"specified; only using the first " MAX_CLAMD_SERVERS_S );
break;
}
}
else /* no virus found */
malware_name = NULL;
+ break;
}
case M_MKSD: /* "mksd" scanner type ------------------------------------- */
}
#endif /*WITH_CONTENT_SCAN*/
+/*
+ * vi: aw ai sw=2
+ */