summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-22 03:45:32 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-22 03:45:32 +0000
commit089557ed8743c7a6948d9277de17d51a7bd8db79 (patch)
tree14450bbad887f7df3be4e81bc4d21c9641dd15f9
parent958bf6215255a14d11108adf39f5106e958dd9b5 (diff)
BUILD : 1.7.6 (458) BUGS : N/A NOTES : Updated our SGLINE/SZLINE support to all ircd where avaiable, this fixes some issues as well 1. Unreal still doesnt do SGLINE well so its still disabled at this time 2. We now enforce SZLINE on ircd with NICKIP 3. Added check_szline() so we can check for szline matches 4. Ultimate3 (s)zline work as documented, which is AKILL without the user part
git-svn-id: svn://svn.anope.org/anope/trunk@458 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@312 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes2
-rw-r--r--include/extern.h3
-rw-r--r--src/bahamut.c2
-rw-r--r--src/dreamforge.c2
-rw-r--r--src/hybrid.c2
-rw-r--r--src/operserv.c26
-rw-r--r--src/ptlink.c45
-rw-r--r--src/rageircd.c3
-rw-r--r--src/ultimate2.c2
-rw-r--r--src/ultimate3.c13
-rw-r--r--src/unreal31.c11
-rw-r--r--src/unreal32.c31
-rw-r--r--src/users.c12
-rw-r--r--src/viagra.c2
-rw-r--r--version.log10
15 files changed, 124 insertions, 42 deletions
diff --git a/Changes b/Changes
index 0a7cb5998..dfe668ce5 100644
--- a/Changes
+++ b/Changes
@@ -7,6 +7,8 @@ Provided by Anope Dev. <dev@anope.org> - 2004
11/19 F Wrong string and missing registered nick check in bot change. [#221]
Provided by Trystan <trystan@nomadirc.net> - 2004
+11/21 A Opened SGLINE to all ircd that support GEOS bans [ #00]
+11/21 A Opened SZLINE to all ircd that support ZLINE's [ #00]
11/19 A Added anope_cmd_ctcp() to code API, for sending CTCP messages. [ #00]
11/20 F Disables UseRDB if there is an error duing SQL init [ #00]
11/20 F MS CHECK now checks if the nick is forbidden. [#225]
diff --git a/include/extern.h b/include/extern.h
index 46d681b47..9c8a889a3 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -766,6 +766,7 @@ E int check_chan_sqline(const char *chan);
E int add_szline(User * u, char *mask, const char *by,
const time_t expires, const char *reason);
E void expire_szlines(void);
+E int check_szline(char *nick, char *ip);
E void check_clones(User * user);
E void delete_ignore(const char *nick);
@@ -1001,7 +1002,7 @@ extern void anope_cmd_remove_akill(char *user, char *host); /* RAKILL */
extern void anope_cmd_server(char *servname, int hop, char *descript); /* SERVER */
extern void anope_cmd_sgline(char *mask, char *reason); /* SGLINE */
extern void anope_cmd_sqline(char *mask, char *reason); /* SQLINE */
-extern void anope_cmd_szline(char *mask, char *reason); /* SZLINE */
+extern void anope_cmd_szline(char *mask, char *reason, char *whom); /* SZLINE */
extern void anope_cmd_squit(char *servname, char *message); /* SQUIT */
extern void anope_cmd_svinfo(); /* SVINFO */
extern void anope_cmd_svsadmin(char *server, int set); /* SVSADMIN */
diff --git a/src/bahamut.c b/src/bahamut.c
index 383e2cf4c..a8a4f911a 100644
--- a/src/bahamut.c
+++ b/src/bahamut.c
@@ -680,7 +680,7 @@ void anope_cmd_unszline(char *mask)
}
/* SZLINE */
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
send_cmd(NULL, "SZLINE %s :%s", mask, reason);
}
diff --git a/src/dreamforge.c b/src/dreamforge.c
index 761166b1f..6cd3edae3 100644
--- a/src/dreamforge.c
+++ b/src/dreamforge.c
@@ -1217,7 +1217,7 @@ void anope_cmd_unszline(char *mask)
}
/* SZLINE */
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
/* Not Supported by this IRCD */
}
diff --git a/src/hybrid.c b/src/hybrid.c
index 3010d2fb5..3d48c5268 100644
--- a/src/hybrid.c
+++ b/src/hybrid.c
@@ -661,7 +661,7 @@ void anope_cmd_unszline(char *mask)
{
/* Does not support */
}
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
/* Does not support */
}
diff --git a/src/operserv.c b/src/operserv.c
index 8f878c6aa..739ea2685 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -3482,11 +3482,35 @@ int add_szline(User * u, char *mask, const char *by, const time_t expires,
entry->expires = expires;
slist_add(&szlines, entry);
- anope_cmd_szline(entry->mask, entry->reason);
+ anope_cmd_szline(entry->mask, entry->reason, entry->by);
return deleted;
}
+/* Check and enforce any Zlines that we have */
+int check_szline(char *nick, char *ip)
+{
+ int i;
+ SXLine *sx;
+
+ if (szlines.count == 0)
+ return 0;
+
+ for (i = 0; i < szlines.count; i++) {
+ sx = szlines.list[i];
+ if (!sx)
+ continue;
+
+ if (match_wild_nocase(sx->mask, ip)) {
+ anope_cmd_szline(sx->mask, sx->reason, sx->by);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
/* Delete any expired SZLINEs. */
void expire_szlines(void)
diff --git a/src/ptlink.c b/src/ptlink.c
index be54ef56f..f4744b2e4 100644
--- a/src/ptlink.c
+++ b/src/ptlink.c
@@ -55,9 +55,9 @@ IRCDVar ircd[] = {
"+r", /* Mode On Reg */
"-r", /* Mode on UnReg */
"+d", /* Mode on Nick Change */
- 0, /* Supports SGlines */
+ 1, /* Supports SGlines */
1, /* Supports SQlines */
- 0, /* Supports SZlines */
+ 1, /* Supports SZlines */
0, /* Supports Halfop +h */
4, /* Number of server args */
0, /* Join 2 Set */
@@ -511,6 +511,7 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
+ m = createMessage("461", anope_event_null); addCoreMessage(IRCD,m);
m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
@@ -554,6 +555,8 @@ void moduleAddIRCDMsgs(void) {
m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
m = createMessage("NJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
m = createMessage("NNICK", anope_event_nick); addCoreMessage(IRCD,m);
+ m = createMessage("ZLINE", anope_event_null); addCoreMessage(IRCD,m);
+ m = createMessage("UNZLINE", anope_event_null); addCoreMessage(IRCD,m);
}
/* *INDENT-ON* */
@@ -1464,16 +1467,6 @@ void anope_cmd_release_svshold(char *nick)
/* Not Supported by this IRCD */
}
-/*
-:%s UNSXLINE %s
- parv[0] = sender
- parv[1] = info ban mask
-*/
-void anope_cmd_unsgline(char *mask)
-{
- /* Not Supported by this IRCD */
-}
-
/*
:%s UNZLINE %s
parv[0] = sender
@@ -1481,7 +1474,7 @@ void anope_cmd_unsgline(char *mask)
*/
void anope_cmd_unszline(char *mask)
{
- /* Not Supported by this IRCD */
+ send_cmd(s_OperServ, "UNZLINE %s", mask);
}
/*
@@ -1491,19 +1484,33 @@ void anope_cmd_unszline(char *mask)
parv[2] = time
parv[3] = reason
*/
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
- /* Not Supported by this IRCD */
+ send_cmd(s_OperServ, "ZLINE %s %ld :%s", mask,
+ (long int) time(NULL) + 86400 * 2, reason);
}
-/*
-:%s SXLINE :%s:%s
+/*
+:%s UNSXLINE %s
parv[0] = sender
- parv[1] = info ban mask:reason
+ parv[1] = info ban mask
*/
+void anope_cmd_unsgline(char *mask)
+{
+ send_cmd(ServerName, "UNSXLINE :%s", mask);
+}
+
+
+/*
+ * sxline - add info ban line
+ *
+ * parv[0] = sender prefix
+ * parv[1] = mask length
+ * parv[2] = real name banned mask:reason
+ */
void anope_cmd_sgline(char *mask, char *reason)
{
- /* Not Supported by this IRCD */
+ send_cmd(ServerName, "SXLINE %d :%s:%s", strlen(mask), mask, reason);
}
/* SVSNICK */
diff --git a/src/rageircd.c b/src/rageircd.c
index d10a76728..bbf3c6b4e 100644
--- a/src/rageircd.c
+++ b/src/rageircd.c
@@ -573,7 +573,8 @@ void anope_cmd_unszline(char *mask)
{
send_cmd(NULL, "UNSZLINE 0 %s", mask);
}
-void anope_cmd_szline(char *mask, char *reason)
+
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
send_cmd(NULL, "SZLINE %s :%s", mask, reason);
}
diff --git a/src/ultimate2.c b/src/ultimate2.c
index 89c19b14c..14f38066a 100644
--- a/src/ultimate2.c
+++ b/src/ultimate2.c
@@ -1533,7 +1533,7 @@ void anope_cmd_unszline(char *mask)
}
/* SZLINE */
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
/* Not Supported by this IRCD */
}
diff --git a/src/ultimate3.c b/src/ultimate3.c
index 3b6dcb2a3..b0ff9ee7a 100644
--- a/src/ultimate3.c
+++ b/src/ultimate3.c
@@ -659,9 +659,18 @@ void anope_cmd_unszline(char *mask)
{
send_cmd(NULL, "UNSZLINE 0 %s", mask);
}
-void anope_cmd_szline(char *mask, char *reason)
+
+/* As of alpha27 (one after our offical support szline was removed */
+/* quote the changelog ---
+ Complete rewrite of the kline/akill/zline system. (s)zlines no longer exist.
+ K: lines set on IP addresses without username portions (or *) are treated as Z: lines used to be.
+*/
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
- send_cmd(NULL, "SZLINE %s :%s", mask, reason);
+ send_cmd(NULL, "AKILL %s * %d %s %ld :%s", mask, 86400 * 2, whom,
+ (long int) time(NULL), reason);
+ /* leaving this in here in case some legacy user asks for it */
+ /* send_cmd(NULL, "SZLINE %s :%s", mask, reason); */
}
void anope_cmd_svsnoop(char *server, int set)
diff --git a/src/unreal31.c b/src/unreal31.c
index 775fa3420..95750926b 100644
--- a/src/unreal31.c
+++ b/src/unreal31.c
@@ -60,7 +60,7 @@ IRCDVar ircd[] = {
"-r+d", /* Mode on Nick Change */
0, /* Supports SGlines */
1, /* Supports SQlines */
- 0, /* Supports SZlines */
+ 1, /* Supports SZlines */
1, /* Supports Halfop +h */
3, /* Number of server args */
0, /* Join 2 Set */
@@ -1433,13 +1433,16 @@ void anope_cmd_unsgline(char *mask)
/* UNSZLINE */
void anope_cmd_unszline(char *mask)
{
- /* Not Supported by this IRCD */
+ send_cmd(NULL, "%s - Z * %s %s", send_token("TKL", "BD"), mask,
+ s_OperServ);
}
/* SZLINE */
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
- /* Not Supported by this IRCD */
+ send_cmd(NULL, "%s + Z * %s %s %ld %ld :%s", send_token("TKL", "BD"),
+ mask, whom, (long int) time(NULL) + 86400 * 2,
+ (long int) time(NULL), reason);
}
/* SGLINE */
diff --git a/src/unreal32.c b/src/unreal32.c
index 77f8161f9..776a89daa 100644
--- a/src/unreal32.c
+++ b/src/unreal32.c
@@ -59,7 +59,7 @@ IRCDVar ircd[] = {
"-r+d", /* Mode on Nick Change */
0, /* Supports SGlines */
1, /* Supports SQlines */
- 0, /* Supports SZlines */
+ 1, /* Supports SZlines */
1, /* Supports Halfop +h */
3, /* Number of server args */
0, /* Join 2 Set */
@@ -1896,27 +1896,46 @@ void anope_cmd_release_svshold(char *nick)
}
/* UNSGLINE */
+/*
+ * SVSNLINE - :realname mask
+*/
void anope_cmd_unsgline(char *mask)
{
- /* Not Supported by this IRCD */
+ /*
+ Although Unreal has SVSNLINE, it has not worked in older version of
+ Unreal 3.2 it confused the tokens, now with 3.2.2 it seems they don't
+ understand the command at all, leaving it disable till I figure out
+ what is going on with it.
+ */
}
/* UNSZLINE */
void anope_cmd_unszline(char *mask)
{
- /* Not Supported by this IRCD */
+ send_cmd(NULL, "%s - Z * %s %s", send_token("TKL", "BD"), mask,
+ s_OperServ);
}
/* SZLINE */
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
- /* Not Supported by this IRCD */
+ send_cmd(NULL, "%s + Z * %s %s %ld %ld :%s", send_token("TKL", "BD"),
+ mask, whom, (long int) time(NULL) + 86400 * 2,
+ (long int) time(NULL), reason);
}
/* SGLINE */
+/*
+ * SVSNLINE + reason_where_is_space :realname mask with spaces
+*/
void anope_cmd_sgline(char *mask, char *reason)
{
- /* Not Supported by this IRCD */
+ /*
+ Although Unreal has SVSNLINE, it has not worked the older version of
+ Unreal 3.2 it confused the tokens, now with 3.2.2 it seems they don't
+ understand the command at all, leaving it disable till I figure out
+ what is going on with it.
+ */
}
/* SVSMODE -b */
diff --git a/src/users.c b/src/users.c
index 4cc41561e..28ccaa9ae 100644
--- a/src/users.c
+++ b/src/users.c
@@ -466,16 +466,24 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
/* return NULL; */
}
}
+
+ /* SGLINE */
if (ircd->sgline) {
- /* Next for SGLINEs */
if (check_sgline(nick, realname))
return NULL;
}
+
+ /* SQLINE */
if (ircd->sqline) {
- /* And for SQLINEs */
if (check_sqline(nick, 0))
return NULL;
}
+
+ /* SZLINE */
+ if (ircd->szline && ircd->nickip) {
+ if (check_szline(nick, ipbuf))
+ return NULL;
+ }
#ifndef STREAMLINED
/* Now check for session limits */
if (LimitSessions && !add_session(nick, host))
diff --git a/src/viagra.c b/src/viagra.c
index b778fe2c7..58910bf5a 100644
--- a/src/viagra.c
+++ b/src/viagra.c
@@ -724,7 +724,7 @@ void anope_cmd_unszline(char *mask)
send_cmd(NULL, "UNSZLINE 0 %s", mask);
}
-void anope_cmd_szline(char *mask, char *reason)
+void anope_cmd_szline(char *mask, char *reason, char *whom)
{
send_cmd(NULL, "SZLINE %s :%s", mask, reason);
}
diff --git a/version.log b/version.log
index 33d6046db..4969f36b2 100644
--- a/version.log
+++ b/version.log
@@ -8,10 +8,18 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="6"
-VERSION_BUILD="457"
+VERSION_BUILD="458"
# $Log$
#
+# BUILD : 1.7.6 (458)
+# BUGS : N/A
+# NOTES : Updated our SGLINE/SZLINE support to all ircd where avaiable, this fixes some issues as well
+# 1. Unreal still doesnt do SGLINE well so its still disabled at this time
+# 2. We now enforce SZLINE on ircd with NICKIP
+# 3. Added check_szline() so we can check for szline matches
+# 4. Ultimate3 (s)zline work as documented, which is AKILL without the user part
+#
# BUILD : 1.7.6 (457)
# BUGS :
# NOTES : Fixed session decrease on /NS GHOST.