Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-02-19 04:46:04 UTC
Modified files:
ChangeLog ircd/ircd_parser.y
Log message:
Make Client blocks more forgiving and fix a bug in Kill reason parsing.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.550 ircu2.10/ChangeLog:1.551
--- ircu2.10/ChangeLog:1.550 Fri Feb 18 19:09:44 2005
+++ ircu2.10/ChangeLog Fri Feb 18 20:45:53 2005
@@ -3,6 +3,11 @@
* ircd/IPcheck.c (ip_registry_find): Use canonical form of IP
address to look up and compare against hash entries.
+ * ircd/ircd_parser.y (clientblock): Stash IP string in aconf->name.
+ (clienthost): Split hosts that contain '@' into username and host.
+ (clientip): Split IPs that contain '@' into username and IP.
+ (killreason): Add missing ~ to mask off DENY_FLAGS_FILE.
+
* ircd/m_silence.c (forward_silences): When we reject a silence,
splice it out of the ban list. Warn the user if he is local.
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.36 ircu2.10/ircd/ircd_parser.y:1.37
--- ircu2.10/ircd/ircd_parser.y:1.36 Tue Jan 25 08:42:03 2005
+++ ircu2.10/ircd/ircd_parser.y Fri Feb 18 20:45:53 2005
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- * $Id: ircd_parser.y,v 1.36 2005/01/25 16:42:03 entrope Exp $
+ * $Id: ircd_parser.y,v 1.37 2005/02/19 04:45:53 entrope Exp $
*/
%{
@@ -654,28 +654,48 @@
unsigned char addrbits;
aconf->username = username;
aconf->host = host;
- if (ip && ipmask_parse(ip, &aconf->address.addr, &addrbits))
+ if (ip && ipmask_parse(ip, &aconf->address.addr, &addrbits)) {
aconf->addrbits = addrbits;
- else
+ aconf->name = ip;
+ } else {
+ MyFree(ip);
aconf->addrbits = -1;
+ DupString(aconf->name, "*");
+ }
aconf->conn_class = c_class ? c_class : find_class("default");
aconf->maximum = maxlinks;
host = NULL;
username = NULL;
c_class = NULL;
- MyFree(ip);
+ ip = NULL;
};
clientitems: clientitem clientitems | clientitem;
clientitem: clienthost | clientip | clientusername | clientclass | clientpass
| clientmaxlinks | error;
clienthost: HOST '=' QSTRING ';'
{
+ char *sep = strchr($3, '@');
MyFree(host);
- DupString(host, $3);
+ if (sep) {
+ *sep++ = '\0';
+ MyFree(username);
+ DupString(username, $3);
+ DupString(host, sep);
+ } else {
+ DupString(host, $3);
+ }
};
clientip: IP '=' QSTRING ';'
{
+ char *sep = strchr($3, '@');
MyFree(ip);
- DupString(ip, $3);
+ if (sep) {
+ *sep++ = '\0';
+ MyFree(username);
+ DupString(username, $3);
+ DupString(ip, sep);
+ } else {
+ DupString(ip, $3);
+ }
};
clientusername: USERNAME '=' QSTRING ';'
{
@@ -751,7 +771,7 @@
killreason: REASON '=' QSTRING ';'
{
- dconf->flags &= DENY_FLAGS_FILE;
+ dconf->flags &= ~DENY_FLAGS_FILE;
MyFree(dconf->message);
DupString(dconf->message, $3);
};
----------------------- End of diff -----------------------