Skip to content

Commit

Permalink
Do not apply akills or sxlines that are pending expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Aug 8, 2012
1 parent d0e5a18 commit 3f05a42
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
40 changes: 28 additions & 12 deletions src/operserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;).
Expand All @@ -867,27 +868,36 @@ 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;
}
}
}
}
if (ircd->nickip) {
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;
}
}
}
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion version.log
Original file line number Diff line number Diff line change
Expand Up @@ -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 @
Expand Down

0 comments on commit 3f05a42

Please sign in to comment.