Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-09-12 20:36:34 UTC
Modified files:
ChangeLog ircd/channel.c
Log message:
Check client hostnames against ban masks more rigorously.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.693 ircu2.10/ChangeLog:1.694
--- ircu2.10/ChangeLog:1.693 Mon Sep 12 09:11:58 2005
+++ ircu2.10/ChangeLog Mon Sep 12 13:36:23 2005
@@ -1,5 +1,11 @@
2005-09-12 Michael Poole <[EMAIL PROTECTED]>
+ * ircd/channel.c (find_ban): Compare ban mask against hostname
+ even when it looks like an IP, to match things like [EMAIL PROTECTED]
when
+ users have a hostname like 1.2.3.example.com.
+
+2005-09-12 Michael Poole <[EMAIL PROTECTED]>
+
* RELEASE.NOTES: Note the resolution of ambiguous ipmasks.
* ircd/ircd_string.c (ipmask_parse): Implement it.
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.150 ircu2.10/ircd/channel.c:1.151
--- ircu2.10/ircd/channel.c:1.150 Thu Sep 1 20:27:27 2005
+++ ircu2.10/ircd/channel.c Mon Sep 12 13:36:24 2005
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.150 2005/09/02 03:27:27 entrope Exp $
+ * @version $Id: channel.c,v 1.151 2005/09/12 20:36:24 entrope Exp $
*/
#include "config.h"
@@ -381,16 +381,15 @@
/* Compare host portion of ban. */
hostmask = banlist->banstr + banlist->nu_len + 1;
if (((banlist->flags & BAN_IPMASK)
- ? !ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits)
- : match(hostmask, iphost))
- && match(hostmask, cli_user(cptr)->host)
- && !(sr && match(hostmask, sr) == 0))
- continue;
- /* If an exception matches, no ban can match. */
- if (banlist->flags & BAN_EXCEPTION)
- return NULL;
- /* Otherwise, remember this ban but keep searching for an exception. */
- found = banlist;
+ && ipmask_check(&cli_ip(cptr), &banlist->address, banlist->addrbits))
+ || match(hostmask, cli_user(cptr)->host)
+ || (sr && match(hostmask, sr) == 0)) {
+ /* If an exception matches, no ban can match. */
+ if (banlist->flags & BAN_EXCEPTION)
+ return NULL;
+ /* Otherwise, remember this ban but keep searching for an exception. */
+ found = banlist;
+ }
}
return found;
}
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches