]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
If the <ALLOW> or <DENY> tag specifies an ip, and this user resolves,
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Jun 2006 15:57:51 +0000 (15:57 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 12 Jun 2006 15:57:51 +0000 (15:57 +0000)
then their ip will be taken as 'priority' anyway, so for example,
<connect allow="127.0.0.1"> will match joe!bloggs@localhost

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3997 e03df62e-2008-0410-955e-edbf42e46eb7

src/helperfuncs.cpp

index a60d83459c50117140b313c58811c8c7aa885315..b2c8c1b3bd228e456f30adc8f372b88c8e929207 100644 (file)
@@ -1390,12 +1390,16 @@ int usercount(chanrec *c)
 }
 
 
-/* looks up a users password for their connection class (<ALLOW>/<DENY> tags) */
+/* looks up a users password for their connection class (<ALLOW>/<DENY> tags)
+ * NOTE: If the <ALLOW> or <DENY> tag specifies an ip, and this user resolves,
+ * then their ip will be taken as 'priority' anyway, so for example,
+ * <connect allow="127.0.0.1"> will match joe!bloggs@localhost
+ */
 ConnectClass GetClass(userrec *user)
 {
        for (ClassVector::iterator i = Config->Classes.begin(); i != Config->Classes.end(); i++)
        {
-               if (match(user->host,i->host.c_str()))
+               if ((match(inet_ntoa(user->ip4),i->host.c_str())) || (match(user->host,i->host.c_str())))
                {
                        return *i;
                }