summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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
12 files changed, 111 insertions, 40 deletions
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);
}