ClamAV is an open source (GPLv2) anti-virus toolkit.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
clamav/clamav-milter/clamfi.c

246 lines
5.9 KiB

Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
/*
* Copyright (C)2008 Sourcefire, Inc.
*
* Author: aCaB <acab@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#if HAVE_CONFIG_H
#include "clamav-config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <libmilter/mfapi.h>
#include "shared/output.h"
#include "connpool.h"
#include "netcode.h"
uint64_t maxfilesize;
#define CLAMFIBUFSZ 1424
struct CLAMFI {
char buffer[CLAMFIBUFSZ];
int local;
int main;
int alt;
unsigned int totsz;
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
unsigned int bufsz;
};
static sfsistat sendchunk(struct CLAMFI *cf, unsigned char *bodyp, size_t len, SMFICTX *ctx) {
if(cf->totsz >= maxfilesize)
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_CONTINUE; /* FIXME: SMFIS_SKIP needs negotiation (only for _body() */
if(cf->totsz + len > maxfilesize)
len = maxfilesize - cf->totsz;
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
if(cf->local) {
while(len) {
int n = write(cf->alt, bodyp, len);
if (n==-1) {
logg("!Failed to write temporary file\n");
close(cf->main);
close(cf->alt);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
len -= n;
bodyp += n;
}
} else {
int sendfailed = 0;
if(len < CLAMFIBUFSZ - cf->bufsz) {
memcpy(&cf->buffer[cf->bufsz], bodyp, len);
cf->bufsz += len;
} else if(len < CLAMFIBUFSZ) {
memcpy(&cf->buffer[cf->bufsz], bodyp, CLAMFIBUFSZ - cf->bufsz);
sendfailed = nc_send(cf->alt, cf->buffer, CLAMFIBUFSZ);
len -= (CLAMFIBUFSZ - cf->bufsz);
memcpy(cf->buffer, &bodyp[CLAMFIBUFSZ - cf->bufsz], len);
cf->bufsz = len;
} else {
if(nc_send(cf->alt, cf->buffer, cf->bufsz) || nc_send(cf->alt, bodyp, len))
sendfailed = 1;
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
cf->bufsz = 0;
}
if(sendfailed) {
logg("!Streaming failed\n");
close(cf->main);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
}
cf->totsz += len;
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_CONTINUE;
}
sfsistat clamfi_header(SMFICTX *ctx, char *headerf, char *headerv) {
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
struct CLAMFI *cf;
sfsistat ret;
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
if(!(cf = (struct CLAMFI *)smfi_getpriv(ctx)))
return SMFIS_CONTINUE; /* whatever */
if(!cf->totsz) {
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
if(nc_connect_rand(&cf->main, &cf->alt, &cf->local)) {
logg("!Failed to initiate streaming/fdpassing\n");
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
free(cf);
return SMFIS_TEMPFAIL;
}
if((ret = sendchunk(cf, (unsigned char *)"From clamav-milter\n", 19, ctx)) != SMFIS_CONTINUE)
return ret;
}
if((ret = sendchunk(cf, (unsigned char *)headerf, strlen(headerf), ctx)) != SMFIS_CONTINUE)
return ret;
if((ret = sendchunk(cf, (unsigned char *)": ", 2, ctx)) != SMFIS_CONTINUE)
return ret;
if((ret = sendchunk(cf, (unsigned char *)headerv, strlen(headerv), ctx)) != SMFIS_CONTINUE)
return ret;
return sendchunk(cf, (unsigned char *)"\r\n", 2, ctx);
}
sfsistat clamfi_body(SMFICTX *ctx, unsigned char *bodyp, size_t len) {
struct CLAMFI *cf;
if(!(cf = (struct CLAMFI *)smfi_getpriv(ctx)))
return SMFIS_CONTINUE; /* whatever */
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return sendchunk(cf, bodyp, len, ctx);
}
sfsistat clamfi_eom(SMFICTX *ctx) {
struct CLAMFI *cf;
char *reply;
int len, ret;
if(!(cf = (struct CLAMFI *)smfi_getpriv(ctx)))
return SMFIS_CONTINUE; /* whatever */
if(cf->local) {
if(nc_send(cf->main, "nFILDES\n", 8)) {
logg("!FD scan request failed\n");
close(cf->alt);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
lseek(cf->alt, 0, SEEK_SET);
if(nc_sendmsg(cf->main, cf->alt) == -1) {
logg("!FD send failed\n");
close(cf->alt);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
} else {
if(cf->bufsz && nc_send(cf->alt, cf->buffer, cf->bufsz)) {
logg("!Failed to flush STREAM\n");
close(cf->main);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
close(cf->alt);
}
reply = nc_recv(cf->main);
if(cf->local)
close(cf->alt);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
if(!reply) {
logg("!No reply from clamd\n");
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
return SMFIS_TEMPFAIL;
}
close(cf->main);
smfi_setpriv(ctx, NULL);
free(cf);
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
len = strlen(reply);
if(len>5 && !strcmp(reply + len - 5, ": OK\n"))
ret = SMFIS_ACCEPT;
else if (len>7 && !strcmp(reply + len - 7, " FOUND\n"))
ret = SMFIS_REJECT;
else {
logg("!Unknown reply from clamd\n");
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
ret = SMFIS_TEMPFAIL;
}
free(reply);
return ret;
}
sfsistat clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr) {
struct CLAMFI *cf;
while(1) {
/* Postfix doesn't seem to honor passing a NULL hostaddr and hostname
set to "localhost" for non-smtp messages (they still appear as SMTP
messages from 127.0.0.1). Here's a small workaround. */
if(hostaddr) {
if(islocalnet_sock(hostaddr)) {
logg("*Skipping scan for %s (in LocalNet)\n", hostname);
return SMFIS_ACCEPT;
}
break;
}
if(!strcasecmp(hostname, "localhost"))
hostname = NULL;
if(islocalnet_name(hostname)) {
logg("*Skipping scan for %s (in LocalNet)\n", hostname ? hostname : "local");
return SMFIS_ACCEPT;
}
break;
}
if(!(cf = (struct CLAMFI *)malloc(sizeof(*cf)))) {
logg("!Failed to allocate CLAMFI struct\n");
return SMFIS_TEMPFAIL;
}
cf->totsz = 0;
cf->bufsz = 0;
smfi_setpriv(ctx, (void *)cf);
return SMFIS_CONTINUE;
}
Squashed commit of the following: commit 0ddbd1a7117e207b8aa87079568a056691d5eb32 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 17:18:04 2008 +0100 to be committed commit 51f8010a275717b8a56a3ab22d49755899819518 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 15:18:40 2008 +0100 mangle body commit cd38463f4739f4a7778b6bf294cfb2166024656e Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 14:43:39 2008 +0100 parse clamd result commit 7b8a39495e59ac745342455f8e9aab09951d1041 Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 03:19:45 2008 +0100 handle calloc shifts commit a58b732af99f9e3f18d2327e977432f1117028ee Author: acab <acab@1337ness.(none)> Date: Thu Nov 27 02:07:19 2008 +0100 spam added, local is b0rked commit 22604b4b037cfdbc92d6b29986652e2f004bd1f3 Author: acab <acab@albe.digitalfuture.it> Date: Wed Nov 26 19:44:59 2008 +0100 free/close stuff commit 33a02aed984981d3e80ca4930a482f702624f08f Author: aCaB <acab@digitalfuture.it> Date: Wed Nov 26 03:11:29 2008 +0100 skeleton ready commit 4630d9902ee74b6137abf6526c6a9ad3e41fc597 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:59:41 2008 +0100 need to rebase commit 083f5f98aecfce2763870f20ae97643d5683613a Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 22:45:11 2008 +0100 in body() commit 08f040f67de1264810953415c0a47c95ec9acff0 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 19:51:15 2008 +0100 clamfi commit bc08fe8f72580b8be81791a7c03ec38952781af7 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 16:47:17 2008 +0100 adding milter commit 34dcebd9294a059f2c45ec9d1817bdb75f423cb3 Author: aCaB <acab@digitalfuture.it> Date: Tue Nov 25 00:35:11 2008 +0100 netcode works, fix to cfgparser commit 3cc0997d907e817954328c60e43cdcca0667d6f3 Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 23:46:05 2008 +0100 socket probe commit 0c3bbd6d03f8df931cb114b07150cd0b7dcd0aff Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 19:02:06 2008 +0100 nonblock started commit a1193ff0de0d0a3d9212d833110236b1329c1f2e Author: aCaB <acab@digitalfuture.it> Date: Mon Nov 24 11:17:41 2008 +0100 legacy options commit 90519c59ff8a4f44fceaf84e8c40116254c73045 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 19:41:26 2008 +0100 sockets pool commit 897b0c5f82503530ba3fbb2fcc3a9c007488e90a Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 23 01:02:59 2008 +0100 Logging done commit 4cf3a218756271c74782a1649f728e1c6e977ae5 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 23:31:34 2008 +0100 Config done commit 93b271579f680286c697476c00d8eec7effb2fc4 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 22:50:42 2008 +0100 Sanitise config file options commit bf5e81b8561b258daaef134894761fa80d44f5b1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 20:25:06 2008 +0100 cfgparser hacks to allow for milter own conf commit 8924e93b2567a1f378c2177b4011b67631b49cc1 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 19:03:45 2008 +0100 command line parser commit d2180e370f75948b6ce12f89979bda9e92ccd5f8 Author: aCaB <acab@digitalfuture.it> Date: Sat Nov 22 16:36:37 2008 +0100 restart from scratch commit 249d6cdbddbea622c949753aafbf48e526e0ef4d Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 19:39:12 2008 +0100 more diversion commit b948990103867b59c749da88d6384128c1e5e6d3 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:31:42 2008 +0100 milter separation (milter) commit 6dc259a5d4f8f6e4428953055510382160ef8df4 Author: aCaB <acab@digitalfuture.it> Date: Sun Nov 16 17:23:14 2008 +0100 milter separation git-svn: trunk@4519
17 years ago
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* tab-width: 8
* End:
* vim: set cindent smartindent autoindent softtabstop=4 shiftwidth=4 tabstop=8:
*/