From ccdff4c324fc9e8caa67a6fcd199a70ccf292542 Mon Sep 17 00:00:00 2001 From: alexhudson Date: Tue, 24 Jul 2007 12:05:19 +0000 Subject: [PATCH] First pass at connmgr removal. Surprisingly little _actually_ uses it... --- Makefile.am | 12 ------- src/agents/imap/Bongo.rules | 1 - src/agents/imap/imapd.c | 2 -- src/agents/imap/session.c | 3 -- src/agents/pop/Bongo.rules | 1 - src/agents/pop/pop3.c | 4 --- src/agents/smtp/Bongo.rules | 1 - src/agents/smtp/smtpd.c | 60 ---------------------------------- src/apps/config/config/manager | 1 - src/libs/logger/logs.conf | 2 -- 10 files changed, 87 deletions(-) diff --git a/Makefile.am b/Makefile.am index ddc0ac2..014eb02 100644 --- a/Makefile.am +++ b/Makefile.am @@ -106,7 +106,6 @@ include_subdirs := \ src/libs/nmap \ src/libs/management \ src/libs/msgapi \ - src/libs/connmgr \ src/libs/calcmd \ src/libs/calcmd/tests \ src/libs/python \ @@ -116,11 +115,6 @@ include_subdirs := \ src/agents/avirus \ src/agents/calcmd \ src/agents/collector \ - src/agents/connmgr \ - src/agents/connmgr/cmmodules/user \ - src/agents/connmgr/cmmodules/rbl \ - src/agents/connmgr/cmmodules/rdns \ - src/agents/connmgr/cmmodules/lists \ src/agents/generic \ src/agents/imap \ src/agents/imap/tests \ @@ -169,7 +163,6 @@ include src/libs/cal/tests/Bongo.rules include src/libs/nmap/Bongo.rules include src/libs/management/Bongo.rules include src/libs/msgapi/Bongo.rules -include src/libs/connmgr/Bongo.rules include src/libs/calcmd/Bongo.rules include src/libs/calcmd/tests/Bongo.rules include src/libs/python/Bongo.rules @@ -179,11 +172,6 @@ include src/agents/antispam/Bongo.rules include src/agents/avirus/Bongo.rules include src/agents/calcmd/Bongo.rules include src/agents/collector/Bongo.rules -include src/agents/connmgr/Bongo.rules -include src/agents/connmgr/cmmodules/user/Bongo.rules -include src/agents/connmgr/cmmodules/rbl/Bongo.rules -include src/agents/connmgr/cmmodules/rdns/Bongo.rules -include src/agents/connmgr/cmmodules/lists/Bongo.rules include src/agents/generic/Bongo.rules include src/agents/imap/Bongo.rules include src/agents/imap/tests/Bongo.rules diff --git a/src/agents/imap/Bongo.rules b/src/agents/imap/Bongo.rules index a4df5a4..a22c1c4 100644 --- a/src/agents/imap/Bongo.rules +++ b/src/agents/imap/Bongo.rules @@ -20,7 +20,6 @@ bongoimap_SOURCES := \ bongoimap_LDADD := \ libbongonmap.la \ - libbongoconnmgr.la \ libbongomanagement.la \ libbongomsgapi.la \ libbongomdb.la \ diff --git a/src/agents/imap/imapd.c b/src/agents/imap/imapd.c index c7fd1cc..0b39273 100644 --- a/src/agents/imap/imapd.c +++ b/src/agents/imap/imapd.c @@ -48,7 +48,6 @@ #include -#include #include "imapd.h" ImapGlobal Imap; @@ -4299,7 +4298,6 @@ XplServiceMain(int argc, char *argv[]) } NMAPInitialize(Imap.directory.handle); - CMInitialize(Imap.directory.handle, "IMAP"); Imap.logHandle = LoggerOpen("bongoimap"); if (Imap.logHandle != NULL) { diff --git a/src/agents/imap/session.c b/src/agents/imap/session.c index 206e076..425d813 100644 --- a/src/agents/imap/session.c +++ b/src/agents/imap/session.c @@ -30,7 +30,6 @@ /* Management Client Header Include */ #include -#include #include "imapd.h" @@ -223,7 +222,6 @@ ImapCommandAuthenticate(void *param) /* We are flushing here so that we can update the connection manager */ /* while the client is working on the response and sending the next command */ if (ConnFlush(session->client.conn) != -1) { -// Reenable me CMAuthenticated((unsigned long)session->client.conn->socketAddress.sin_addr.s_addr, session->user.name); return(STATUS_CONTINUE); } } @@ -261,7 +259,6 @@ ImapCommandLogin(void *param) /* We are flushing here so that we can update the connection manager */ /* while the client is working on the response and sending the next command */ if (ConnFlush(session->client.conn) != -1) { -// Reenable me CMAuthenticated((unsigned long)session->client.conn->socketAddress.sin_addr.s_addr, session->user.name); return(STATUS_CONTINUE); } else { ccode = STATUS_ABORT; diff --git a/src/agents/pop/Bongo.rules b/src/agents/pop/Bongo.rules index ec1e01a..9d2309e 100644 --- a/src/agents/pop/Bongo.rules +++ b/src/agents/pop/Bongo.rules @@ -7,7 +7,6 @@ bongopop3_SOURCES := \ bongopop3_LDADD := \ libbongonmap.la \ - libbongoconnmgr.la \ libbongomanagement.la \ libbongomsgapi.la \ libbongomdb.la \ diff --git a/src/agents/pop/pop3.c b/src/agents/pop/pop3.c index d35cdb5..028957a 100644 --- a/src/agents/pop/pop3.c +++ b/src/agents/pop/pop3.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -657,7 +656,6 @@ POP3CommandAuth(void *param) if (!ccode) { LoggerEvent(POP3.loggingHandle, LOGGER_SUBSYSTEM_AUTH, LOGGER_EVENT_LOGIN, LOG_INFO, 0, client->user, NULL, XplHostToLittle(client->conn->socketAddress.sin_addr.s_addr), 0, NULL, 0); - CMAuthenticated((unsigned long)client->conn->socketAddress.sin_addr.s_addr, client->user); } else { if (ccode == POP3_NMAP_SERVER_DOWN) { ConnWriteF(client->conn, "-ERR [SYS/PERM] %s %s\r\n", POP3.hostName, MSGERRNONMAP); @@ -916,7 +914,6 @@ POP3CommandPass(void *param) ccode = ConnectUserToNMAPServer(client, client->user, ptr); if (!ccode) { Log(LOG_INFO, "User %s logged in from host %s", client->user, LOGIP(client->conn->socketAddress)); - CMAuthenticated((unsigned long)client->conn->socketAddress.sin_addr.s_addr, client->user); } else { if (ccode == POP3_NMAP_SERVER_DOWN) { ConnWriteF(client->conn, "-ERR [SYS/PERM] %s %s\r\n", POP3.hostName, MSGERRNONMAP); @@ -2158,7 +2155,6 @@ XplServiceMain(int argc, char *argv[]) } NMAPInitialize(POP3.directoryHandle); - CMInitialize(POP3.directoryHandle, "POP3"); POP3.loggingHandle = LoggerOpen("bongopop3"); if (POP3.loggingHandle == NULL) { diff --git a/src/agents/smtp/Bongo.rules b/src/agents/smtp/Bongo.rules index fd83986..af7c22d 100644 --- a/src/agents/smtp/Bongo.rules +++ b/src/agents/smtp/Bongo.rules @@ -7,7 +7,6 @@ bongosmtp_SOURCES := \ bongosmtp_LDADD := \ libbongonmap.la \ - libbongoconnmgr.la \ libbongomanagement.la \ libbongomsgapi.la \ libbongomdb.la \ diff --git a/src/agents/smtp/smtpd.c b/src/agents/smtp/smtpd.c index 34ce1b3..ed21899 100644 --- a/src/agents/smtp/smtpd.c +++ b/src/agents/smtp/smtpd.c @@ -41,7 +41,6 @@ #include #include -#include #include #include "smtpd.h" @@ -304,8 +303,6 @@ EndClientConnection (ConnectionStruct * Client) } if (Client->client.conn) { - CMDisconnected (Client->client.conn->socketAddress.sin_addr.s_addr); - FreeInternalConnection(Client->client); } @@ -369,62 +366,6 @@ HandleConnection (void *param) AllowAuth = FALSE; } - ReplyInt = CMVerifyConnect (Client->client.conn->socketAddress.sin_addr.s_addr, Answer, &RequireAuth); - if (ReplyInt == CM_RESULT_DENY_PERMANENT) { - /* We don't like the guy */ - XplRWReadLockRelease (&ConfigLock); - Log(LOG_INFO, "Connection from %s blocked", LOGIP(Client->client.conn->socketAddress)); - - if (Answer[0] != '\0') { - ConnWrite (Client->client.conn, MSG553COMMENT, MSG553COMMENT_LEN); - ConnWrite (Client->client.conn, Answer, strlen (Answer)); - ConnWrite (Client->client.conn, "\r\n", 2); - } - else { - ConnWrite (Client->client.conn, MSG550SPAMBLOCK, MSG550SPAMBLOCK_LEN); - } - ConnFlush (Client->client.conn); - return (EndClientConnection (Client)); - } else if (ReplyInt != CM_RESULT_ALLOWED) { - /* Either we don't like the guy, or there was an error */ - XplRWReadLockRelease (&ConfigLock); - Log(LOG_INFO, "Connection from %s blocked by blocklist %d", - LOGIP(Client->client.conn->socketAddress), - LOGGING_BLOCK_BLOCKLIST); - - if (Answer[0] != '\0') { - ConnWrite (Client->client.conn, MSG453COMMENT, MSG453COMMENT_LEN); - ConnWrite (Client->client.conn, Answer, strlen (Answer)); - ConnWrite (Client->client.conn, "\r\n", 2); - } else { - ConnWrite (Client->client.conn, MSG453TRYLATER, MSG453TRYLATER_LEN); - } - ConnFlush (Client->client.conn); - return (EndClientConnection (Client)); - } - - if (UBEConfig & UBE_DEFAULT_NOT_TRUSTED) { - IsTrusted = FALSE; - - if (UBEConfig & UBE_SMTP_AFTER_POP) { - ReplyInt = CMVerifyRelay (Client->client.conn->socketAddress.sin_addr.s_addr, Answer); - if (ReplyInt == CM_RESULT_ALLOWED) { - if (Answer[0] != '\0') { - if (Client->AuthFrom == NULL) { - Client->AuthFrom = MemStrdup (Answer); - IsTrusted = TRUE; - } else { - MemFree (Client->AuthFrom); - Client->AuthFrom = MemStrdup (Answer); - IsTrusted = TRUE; - } - } else { - IsTrusted = TRUE; - } - } - } - } - XplRWReadLockRelease (&ConfigLock); /* Connect to Queue agent */ @@ -5137,7 +5078,6 @@ int XplServiceMain (int argc, char *argv[]) exit (-1); } - CMInitialize(SMTPDirectoryHandle, "SMTP"); NMAPInitialize(SMTPDirectoryHandle); XplRWLockInit (&ConfigLock); diff --git a/src/apps/config/config/manager b/src/apps/config/config/manager index 9508bec..153730d 100644 --- a/src/apps/config/config/manager +++ b/src/apps/config/config/manager @@ -13,7 +13,6 @@ { "name": "bongoavirus", "pri": 5, "enabled": true }, { "name": "bongocollector", "pri": 7, "enabled": true }, { "name": "bongomailprox", "pri": 7, "enabled": true }, - { "name": "bongoconnmgr", "pri": 2, "enabled": true }, { "name": "bongopluspack", "pri": 5, "enabled": true }, { "name": "bongorules", "pri": 2, "enabled": true }, { "name": "bongoimap", "pri": 10, "enabled": true }, diff --git a/src/libs/logger/logs.conf b/src/libs/logger/logs.conf index e5207bd..c17f33b 100644 --- a/src/libs/logger/logs.conf +++ b/src/libs/logger/logs.conf @@ -11,10 +11,8 @@ - -