summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-08-07 22:16:32 -0400
committerAdam <Adam@anope.org>2012-08-07 22:16:32 -0400
commit3f05a42515b588b508419040e71b74ea2a27f1d0 (patch)
tree8752484ca102982f5293a078a0c6c76bcf426d73
parentd0e5a188489c8e760bd0997a9fbcdfd64907eda8 (diff)
Do not apply akills or sxlines that are pending expiration
-rw-r--r--src/operserv.c40
-rw-r--r--version.log3
2 files changed, 30 insertions, 13 deletions
diff --git a/src/operserv.c b/src/operserv.c
index 74a2377dc..af249375c 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -849,6 +849,7 @@ int check_akill(char *nick, const char *username, const char *host,
{
int i;
Akill *ak;
+ time_t now = time(NULL);
/**
* If DefCon is set to NO new users - kill the user ;).
@@ -867,17 +868,23 @@ int check_akill(char *nick, const char *username, const char *host,
continue;
if (match_wild_nocase(ak->user, username)
&& match_wild_nocase(ak->host, host)) {
- anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
+ if (!ak->expires || ak->expires > now) {
+ anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
ak->expires, ak->reason);
- return 1;
+ return 1;
+ }
}
if (ircd->vhost) {
if (vhost) {
if (match_wild_nocase(ak->user, username)
&& match_wild_nocase(ak->host, vhost)) {
- anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
+
+ if (!ak->expires || ak->expires > now) {
+ anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
ak->expires, ak->reason);
- return 1;
+
+ return 1;
+ }
}
}
}
@@ -885,9 +892,12 @@ int check_akill(char *nick, const char *username, const char *host,
if (ip) {
if (match_wild_nocase(ak->user, username)
&& match_wild_nocase(ak->host, ip)) {
- anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
+
+ if (!ak->expires || ak->expires > now) {
+ anope_cmd_akill(ak->user, ak->host, ak->by, ak->seton,
ak->expires, ak->reason);
- return 1;
+ return 1;
+ }
}
}
}
@@ -1065,6 +1075,7 @@ int check_sgline(char *nick, const char *realname)
{
int i;
SXLine *sx;
+ time_t now = time(NULL);
if (sglines.count == 0)
return 0;
@@ -1075,10 +1086,12 @@ int check_sgline(char *nick, const char *realname)
continue;
if (match_wild_nocase(sx->mask, realname)) {
- anope_cmd_sgline(sx->mask, sx->reason);
- /* We kill nick since s_sgline can't */
- anope_cmd_svskill(ServerName, nick, "G-Lined: %s", sx->reason);
- return 1;
+ if (!sx->expires || sx->expires > now) {
+ anope_cmd_sgline(sx->mask, sx->reason);
+ /* We kill nick since s_sgline can't */
+ anope_cmd_svskill(ServerName, nick, "G-Lined: %s", sx->reason);
+ return 1;
+ }
}
}
@@ -1449,6 +1462,7 @@ int check_szline(char *nick, char *ip)
{
int i;
SXLine *sx;
+ time_t now = time(NULL);
if (szlines.count == 0) {
return 0;
@@ -1465,8 +1479,10 @@ int check_szline(char *nick, char *ip)
}
if (match_wild_nocase(sx->mask, ip)) {
- anope_cmd_szline(sx->mask, sx->reason, sx->by);
- return 1;
+ if (!sx->expires || sx->expires > now) {
+ anope_cmd_szline(sx->mask, sx->reason, sx->by);
+ return 1;
+ }
}
}
diff --git a/version.log b/version.log
index d4b84a078..6de54230c 100644
--- a/version.log
+++ b/version.log
@@ -8,9 +8,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="8"
VERSION_EXTRA="-git"
-VERSION_BUILD="3096"
+VERSION_BUILD="3097"
# Changes since 1.8.7 Release
+#Revision 3097 - Do not apply akills or sxlines that are pending expiration
#Revision 3096 - Fixed crash when InspIRCd sends user MODE changes for users that don't exist
#Revision 3095 - Fixed crash with cs_enforce and registered empty permanent channels
#Revision 3094 - Bug #1380 - Do not allow akill masks to end in @