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/clamav-milter.c

461 lines
14 KiB

/*
* Copyright (C) 2013-2020 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
* Copyright (C) 2008-2013 Sourcefire, Inc.
*
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
* Author: aCaB <acab@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
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
* 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 <stdio.h>
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
#include <sys/types.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
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
#include <string.h>
#include <signal.h>
#include <pthread.h>
#ifdef USE_SYSLOG
#include <syslog.h>
#endif
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
#include <time.h>
#include <libmilter/mfapi.h>
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
#include "clamav.h"
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
#include "shared/output.h"
#include "shared/optparser.h"
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
#include "shared/misc.h"
15 years ago
#include "libclamav/default.h"
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
#include "connpool.h"
#include "netcode.h"
#include "clamfi.h"
#include "whitelist.h"
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 smfiDesc descr;
struct optstruct *opts;
static void milter_exit(int sig)
{
const struct optstruct *opt;
logg("*clamav-milter: milter_exit, signal %d\n", sig);
#ifndef _WIN32
if ((opt = optget(opts, "MilterSocket"))) {
if (unlink(opt->strarg) == -1)
logg("!Can't unlink the socket file %s\n", opt->strarg);
else
logg("Socket file removed.\n");
}
#endif
logg("clamav-milter: stopped\n");
optfree(opts);
logg_close();
cpool_free();
localnets_free();
whitelist_free();
}
int main(int argc, char **argv)
{
char *my_socket, *pt;
const struct optstruct *opt;
time_t currtime;
mode_t umsk;
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
int ret;
sigset_t sigset;
struct sigaction act;
sigfillset(&sigset);
sigdelset(&sigset, SIGUSR1);
sigdelset(&sigset, SIGFPE);
sigdelset(&sigset, SIGILL);
sigdelset(&sigset, SIGSEGV);
#ifdef SIGBUS
sigdelset(&sigset, SIGBUS);
#endif
pthread_sigmask(SIG_SETMASK, &sigset, NULL);
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = milter_exit;
sigfillset(&(act.sa_mask));
sigaction(SIGUSR1, &act, NULL);
sigaction(SIGSEGV, &act, NULL);
cl_initialize_crypto();
memset(&descr, 0, sizeof(struct smfiDesc));
descr.xxfi_name = "ClamAV"; /* filter name */
descr.xxfi_version = SMFI_VERSION; /* milter version */
descr.xxfi_flags = SMFIF_QUARANTINE; /* flags */
descr.xxfi_connect = clamfi_connect; /* connection info filter */
descr.xxfi_envfrom = clamfi_envfrom; /* envelope sender filter */
descr.xxfi_envrcpt = clamfi_envrcpt; /* envelope recipient filter */
descr.xxfi_header = clamfi_header; /* header filter */
descr.xxfi_body = clamfi_body; /* body block */
descr.xxfi_eom = clamfi_eom; /* end of message */
descr.xxfi_abort = clamfi_abort; /* message aborted */
opts = optparse(NULL, argc, argv, 1, OPT_MILTER, 0, NULL);
if (!opts) {
mprintf("!Can't parse command line options\n");
return 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
}
if (optget(opts, "help")->enabled) {
printf("\n");
printf(" Clam AntiVirus: Milter Mail Scanner %s\n", get_version());
printf(" By The ClamAV Team: https://www.clamav.net/about.html#credits\n");
printf(" (C) 2020 Cisco Systems, Inc.\n");
printf("\n");
printf(" %s [-c <config-file>]\n\n", argv[0]);
printf("\n");
printf(" --help -h Show this help\n");
printf(" --version -V Show version\n");
printf(" --config-file <file> -c Read configuration from file\n");
printf("\n");
optfree(opts);
return 0;
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 (opts->filename) {
int x;
for (x = 0; opts->filename[x]; x++)
mprintf("^Ignoring option %s\n", opts->filename[x]);
}
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 (optget(opts, "version")->enabled) {
printf("clamav-milter %s\n", get_version());
optfree(opts);
return 0;
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
}
pt = strdup(optget(opts, "config-file")->strarg);
if (pt == NULL) {
printf("Unable to allocate memory for config file\n");
return 1;
}
if ((opts = optparse(pt, 0, NULL, 1, OPT_MILTER, 0, opts)) == NULL) {
printf("%s: cannot parse config file %s\n", argv[0], pt);
free(pt);
return 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
}
free(pt);
if ((opt = optget(opts, "Chroot"))->enabled) {
if (chdir(opt->strarg) != 0) {
logg("!Cannot change directory to %s\n", opt->strarg);
return 1;
}
if (chroot(opt->strarg) != 0) {
logg("!chroot to %s failed. Are you root?\n", opt->strarg);
return 1;
}
}
pt = optget(opts, "AddHeader")->strarg;
if (strcasecmp(pt, "No")) {
char myname[255];
if (((opt = optget(opts, "ReportHostname"))->enabled &&
strncpy(myname, opt->strarg, sizeof(myname))) ||
!gethostname(myname, sizeof(myname))) {
myname[sizeof(myname) - 1] = '\0';
snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s at %s",
get_version(), myname);
} else {
snprintf(xvirushdr, sizeof(xvirushdr), "clamav-milter %s",
get_version());
}
xvirushdr[sizeof(xvirushdr) - 1] = '\0';
descr.xxfi_flags |= SMFIF_ADDHDRS;
if (strcasecmp(pt, "Add")) { /* Replace or Yes */
descr.xxfi_flags |= SMFIF_CHGHDRS;
addxvirus = 1;
} else { /* Add */
addxvirus = 2;
}
}
if (!(my_socket = optget(opts, "MilterSocket")->strarg)) {
logg("!Please configure the MilterSocket directive\n");
logg_close();
optfree(opts);
return 1;
}
if (smfi_setconn(my_socket) == MI_FAILURE) {
logg("!smfi_setconn failed\n");
logg_close();
optfree(opts);
return 1;
}
if (smfi_register(descr) == MI_FAILURE) {
logg("!smfi_register failed\n");
logg_close();
optfree(opts);
return 1;
}
opt = optget(opts, "FixStaleSocket");
umsk = umask(0777); /* socket is created with 000 to avoid races */
if (smfi_opensocket(opt->enabled) == MI_FAILURE) {
logg("!Failed to create socket %s\n", my_socket);
logg_close();
optfree(opts);
return 1;
}
umask(umsk); /* restore umask */
if (strncmp(my_socket, "inet:", 5) && strncmp(my_socket, "inet6:", 6)) {
/* set group ownership and perms on the local socket */
char *sock_name = my_socket;
mode_t sock_mode;
if (!strncmp(my_socket, "unix:", 5))
sock_name += 5;
if (!strncmp(my_socket, "local:", 6))
sock_name += 6;
if (*my_socket == ':')
sock_name++;
if (optget(opts, "MilterSocketGroup")->enabled) {
char *gname = optget(opts, "MilterSocketGroup")->strarg, *end;
gid_t sock_gid = strtol(gname, &end, 10);
if (*end) {
struct group *pgrp = getgrnam(gname);
if (!pgrp) {
logg("!Unknown group %s\n", gname);
logg_close();
optfree(opts);
return 1;
}
sock_gid = pgrp->gr_gid;
}
if (chown(sock_name, -1, sock_gid)) {
logg("!Failed to change socket ownership to group %s\n", gname);
logg_close();
optfree(opts);
return 1;
}
}
if ((opt = optget(opts, "User"))->enabled) {
struct passwd *user;
if ((user = getpwnam(opt->strarg)) == NULL) {
logg("ERROR: Can't get information about user %s.\n",
opt->strarg);
logg_close();
optfree(opts);
return 1;
}
if (chown(sock_name, user->pw_uid, -1)) {
logg("!Failed to change socket ownership to user %s\n", user->pw_name);
optfree(opts);
logg_close();
return 1;
}
}
if (optget(opts, "MilterSocketMode")->enabled) {
char *end;
sock_mode = strtol(optget(opts, "MilterSocketMode")->strarg, &end, 8);
if (*end) {
logg("!Invalid MilterSocketMode %s\n", optget(opts, "MilterSocketMode")->strarg);
logg_close();
optfree(opts);
return 1;
}
} else
sock_mode = 0777 & ~umsk;
if (chmod(sock_name, sock_mode & 0666)) {
logg("!Cannot set milter socket permission to %s\n", optget(opts, "MilterSocketMode")->strarg);
logg_close();
optfree(opts);
return 1;
}
}
if (geteuid() == 0 && (opt = optget(opts, "User"))->enabled) {
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 passwd *user = NULL;
if ((user = getpwnam(opt->strarg)) == NULL) {
fprintf(stderr, "ERROR: Can't get information about user %s.\n", opt->strarg);
optfree(opts);
return 1;
}
#ifdef HAVE_INITGROUPS
if (initgroups(opt->strarg, user->pw_gid)) {
fprintf(stderr, "ERROR: initgroups() failed.\n");
optfree(opts);
return 1;
}
#elif HAVE_SETGROUPS
if (setgroups(1, &user->pw_gid)) {
fprintf(stderr, "ERROR: setgroups() failed.\n");
optfree(opts);
return 1;
}
#endif
if (setgid(user->pw_gid)) {
fprintf(stderr, "ERROR: setgid(%d) failed.\n", (int)user->pw_gid);
optfree(opts);
return 1;
}
if (setuid(user->pw_uid)) {
fprintf(stderr, "ERROR: setuid(%d) failed.\n", (int)user->pw_uid);
optfree(opts);
return 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
}
logg_lock = !optget(opts, "LogFileUnlock")->enabled;
logg_time = optget(opts, "LogTime")->enabled;
logg_size = optget(opts, "LogFileMaxSize")->numarg;
logg_verbose = mprintf_verbose = optget(opts, "LogVerbose")->enabled;
if (logg_size)
logg_rotate = optget(opts, "LogRotate")->enabled;
if ((opt = optget(opts, "LogFile"))->enabled) {
logg_file = opt->strarg;
if (!cli_is_abspath(logg_file)) {
fprintf(stderr, "ERROR: LogFile requires full path.\n");
logg_close();
optfree(opts);
return 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
} else
logg_file = NULL;
#if defined(USE_SYSLOG) && !defined(C_AIX)
if (optget(opts, "LogSyslog")->enabled) {
int fac;
opt = optget(opts, "LogFacility");
if ((fac = logg_facility(opt->strarg)) == -1) {
logg("!LogFacility: %s: No such facility.\n", opt->strarg);
logg_close();
optfree(opts);
return 1;
}
openlog("clamav-milter", LOG_PID, fac);
logg_syslog = 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
}
#endif
time(&currtime);
if (logg("#+++ Started at %s", ctime(&currtime))) {
fprintf(stderr, "ERROR: Can't initialize the internal logger\n");
logg_close();
optfree(opts);
return 1;
}
if ((opt = optget(opts, "TemporaryDirectory"))->enabled)
tempdir = opt->strarg;
if (localnets_init(opts) || init_actions(opts)) {
logg_close();
optfree(opts);
return 1;
}
if ((opt = optget(opts, "Whitelist"))->enabled && whitelist_init(opt->strarg)) {
localnets_free();
logg_close();
optfree(opts);
return 1;
}
if ((opt = optget(opts, "SkipAuthenticated"))->enabled && smtpauth_init(opt->strarg)) {
localnets_free();
whitelist_free();
logg_close();
optfree(opts);
return 1;
}
14 years ago
multircpt = optget(opts, "SupportMultipleRecipients")->enabled;
if (!optget(opts, "Foreground")->enabled) {
if (daemonize() == -1) {
logg("!daemonize() failed\n");
localnets_free();
whitelist_free();
cpool_free();
logg_close();
optfree(opts);
return 1;
}
if (chdir("/") == -1)
logg("^Can't change current working directory to root\n");
}
maxfilesize = optget(opts, "MaxFileSize")->numarg;
if (!maxfilesize) {
logg("^Invalid MaxFileSize, using default (%d)\n", CLI_DEFAULT_MAXFILESIZE);
maxfilesize = CLI_DEFAULT_MAXFILESIZE;
15 years ago
}
readtimeout = optget(opts, "ReadTimeout")->numarg;
cpool_init(opts);
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 (!cp) {
logg("!Failed to init the socket pool\n");
localnets_free();
whitelist_free();
logg_close();
optfree(opts);
return 1;
}
if ((opt = optget(opts, "PidFile"))->enabled) {
FILE *fd;
mode_t old_umask = umask(0002);
if ((fd = fopen(opt->strarg, "w")) == NULL) {
logg("!Can't save PID in file %s\n", opt->strarg);
} else {
if (fprintf(fd, "%u\n", (unsigned int)getpid()) < 0) {
logg("!Can't save PID in file %s\n", opt->strarg);
}
fclose(fd);
}
umask(old_umask);
}
return smfi_main();
}
/*
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:
*/