remove_temp_glines() without legacy api
This commit is contained in:
parent
d20d004550
commit
9168d56f1f
1 changed files with 42 additions and 43 deletions
|
@ -684,47 +684,46 @@ majority_gline(struct Client *source_p, const char *user,
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove_temp_gline()
|
/* remove_temp_gline()
|
||||||
*
|
*
|
||||||
* inputs - username, hostname to ungline
|
* inputs - username, hostname to ungline
|
||||||
* outputs -
|
* outputs -
|
||||||
* side effects - tries to ungline anything that matches
|
* side effects - tries to ungline anything that matches
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
remove_temp_gline(const char *user, const char *host)
|
remove_temp_gline(const char *user, const char *host)
|
||||||
{
|
{
|
||||||
struct ConfItem *aconf;
|
struct ConfItem *aconf;
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
struct rb_sockaddr_storage addr, caddr;
|
struct rb_sockaddr_storage addr, caddr;
|
||||||
int bits, cbits;
|
int bits, cbits;
|
||||||
int mtype, gtype;
|
int mtype, gtype;
|
||||||
|
|
||||||
mtype = parse_netmask(host, (struct sockaddr *)&addr, &bits);
|
mtype = parse_netmask(host, (struct sockaddr *)&addr, &bits);
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, glines.head)
|
RB_DLINK_FOREACH(ptr, glines.head)
|
||||||
{
|
{
|
||||||
aconf = ptr->data;
|
aconf = ptr->data;
|
||||||
|
|
||||||
gtype = parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
|
gtype = parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
|
||||||
|
|
||||||
if(gtype != mtype || (user && irccmp(user, aconf->user)))
|
if(gtype != mtype || (user && irccmp(user, aconf->user)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(gtype == HM_HOST)
|
if(gtype == HM_HOST)
|
||||||
{
|
{
|
||||||
if(irccmp(aconf->host, host))
|
if(irccmp(aconf->host, host))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if(bits != cbits ||
|
else if(bits != cbits ||
|
||||||
!comp_with_mask_sock((struct sockaddr *)&addr,
|
!comp_with_mask_sock((struct sockaddr *)&addr,
|
||||||
(struct sockaddr *)&caddr, bits))
|
(struct sockaddr *)&caddr, bits))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rb_dlinkDestroy(ptr, &glines);
|
rb_dlinkDestroy(ptr, &glines);
|
||||||
remove_reject_mask(aconf->user, aconf->host);
|
delete_one_address_conf(aconf->host, aconf);
|
||||||
delete_one_address_conf(aconf->host, aconf);
|
return YES;
|
||||||
return YES;
|
}
|
||||||
}
|
|
||||||
|
return NO;
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue