summaryrefslogtreecommitdiff
path: root/src/modules/m_cgiirc.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-08 22:45:12 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-08 22:45:12 +0000
commit31b785cb03d616a7989c57279d76f05f8d9aa9c3 (patch)
tree246c99929c2f790dcdd2983b53c7de2ce36d3eae /src/modules/m_cgiirc.cpp
parent9210fdcc7afee2ff4029a80286d08bfcca4b4f70 (diff)
Fix low-risk potential memory leak: if a webirc client with valid cgiirc block connects, issues /webirc, and quits before fully connecting, memory will be leaked. OnUserQuit is only triggered for fully connected users, use OnUserDisconnect otherwise.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8852 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cgiirc.cpp')
-rw-r--r--src/modules/m_cgiirc.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 3d0c48b7c..e854b8d4e 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -40,6 +40,17 @@ public:
};
typedef std::vector<CGIhost> CGIHostlist;
+/*
+ * WEBIRC
+ * This is used for the webirc method of CGIIRC auth, and is (really) the best way to do these things.
+ * Syntax: WEBIRC password client hostname ip
+ * Where password is a shared key, client is the name of the "client" and version (e.g. cgiirc), hostname
+ * is the resolved host of the client issuing the command and IP is the real IP of the client.
+ *
+ * How it works:
+ * To tie in with the rest of cgiirc module, and to avoid race conditions, /webirc is only processed locally
+ * and simply sets metadata on the user, which is later decoded on full connect to give something meaningful.
+ */
class CommandWebirc : public Command
{
InspIRCd* Me;
@@ -134,7 +145,7 @@ public:
mycommand = new CommandWebirc(Me, Hosts, NotifyOpers);
ServerInstance->AddCommand(mycommand);
- Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCleanup, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUserQuit, I_OnUserConnect };
+ Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCleanup, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect };
ServerInstance->Modules->Attach(eventlist, this, 7);
}
@@ -240,7 +251,7 @@ public:
}
}
- virtual void OnUserQuit(User* user, const std::string &message, const std::string &oper_message)
+ virtual void OnUserDisconnect(User* user)
{
OnCleanup(TYPE_USER, user);
}