Hi all,
I have found some minor porting bugs in the reject windows executables
feature of qmail-smtpd.
The attached patch will fix the problem, without it no windows executables
are detected and so all mails are passed.
With the patch windows executables like the sobig.f are now detected and
rejected on smtp level.
Note: only direct attached executables are detected, zipped or otherwise
packed executables are not detected. In other words almost all viruses are
detected but only a minor part of valid delivered applications will hit
the filter.
--
:wq Claudio
Index: execcheck.c
===================================================================
RCS file: /home/cvs-qmail-ldap/CVS/qmail-ldap/execcheck.c,v
retrieving revision 1.1
diff -u -r1.1 execcheck.c
--- execcheck.c 30 Jul 2003 17:16:48 -0000 1.1
+++ execcheck.c 21 Aug 2003 08:57:57 -0000
@@ -52,7 +52,7 @@
}
void
-execcheck_put(struct qmail *qqt, char *ch)
+execcheck_put(struct qmail *qq, char *ch)
{
char *cp, *cpstart, *cpafter;
unsigned int len;
@@ -101,8 +101,8 @@
while (cp < cpafter &&
(*cp == ' ' || *cp == '\t'))
++cp;
- if (9 > cpafter - cp &&
- case_diffb(cp, 9, "boundary=")) {
+ if (9 < cpafter - cp &&
+ case_diffb(cp, 9, "boundary=")==0) {
cp += 9; /* after boundary= */
if (cp < cpafter &&
*cp == '"') {
@@ -172,7 +172,7 @@
!str_diffn(line.s,"TVouARsAA",9) ||
!str_diffn(line.s,"TVrQAT8AA",9)) {
flagexecutable = 1;
- qmail_fail(&qqt);
+ qmail_fail(qq);
}
linespastheader = 2;
}