From: Jeremy Harris Date: Sat, 20 Dec 2014 18:24:25 +0000 (+0000) Subject: Tweak Avast scanner interface X-Git-Url: https://git.exim.org/users/jgh/exim.git/commitdiff_plain/6fc611adf5056bd896a19fb9fac0f385d907f079?hp=bf58e4863288717f1c844d2f2c67c00ba22c91ad Tweak Avast scanner interface --- diff --git a/src/src/malware.c b/src/src/malware.c index 9099c8a5b..167f47f2c 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -1574,6 +1574,8 @@ malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) goto endloop; /* require a 200 */ sendreq: + { + int len; /* Check for another option to send. Newline-terminate it. */ if ((scanrequest = string_nextinlist(&av_scanner_work, &sep, NULL, 0))) @@ -1583,18 +1585,22 @@ malware_internal(uschar **listptr, uschar *eml_filename, BOOL faking) } else { - scanrequest = string_sprintf("SCAN %s/scan/%s\r\n", + scanrequest = string_sprintf("SCAN %s/scan/%s\n", spool_directory, message_id); avast_stage = AVA_RSP; /* just sent command */ } /* send config-cmd or scan-request to socket */ - if (send(sock, scanrequest, Ustrlen(scanrequest), 0) < 0) + len = Ustrlen(scanrequest); + if (send(sock, scanrequest, len, 0) < 0) + { + scanrequest[len-1] = '\0'; return m_errlog_defer_3(scanent, string_sprintf( - "unable to send scan request to socket (%s): %s", - scanner_options, strerror(errno)), - sock); + "unable to send request '%s' to socket (%s): %s", + scanrequest, scanner_options, strerror(errno)), sock); + } break; + } case AVA_RSP: if (Ustrncmp(buf, "210", 3) == 0)