blacklist: add notices that we're performing checks.
This commit is contained in:
parent
4d1e498977
commit
7246347058
1 changed files with 20 additions and 6 deletions
|
@ -223,6 +223,7 @@ blwarn:
|
||||||
bl->host, ipaddr);
|
bl->host, ipaddr);
|
||||||
bl->lastwarning = rb_current_time();
|
bl->lastwarning = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,6 +261,8 @@ blacklist_dns_callback(const char *result, bool status, query_type type, void *d
|
||||||
if(!rb_dlink_list_length(&bluser->queries))
|
if(!rb_dlink_list_length(&bluser->queries))
|
||||||
{
|
{
|
||||||
/* Done here */
|
/* Done here */
|
||||||
|
notice_client(auth->cid, "*** IP not found in DNS blacklist%s",
|
||||||
|
rb_dlink_list_length(blacklist_list) > 1 : "s" : "");
|
||||||
rb_free(bluser);
|
rb_free(bluser);
|
||||||
auth->data[PROVIDER_BLACKLIST] = NULL;
|
auth->data[PROVIDER_BLACKLIST] = NULL;
|
||||||
provider_done(auth, PROVIDER_BLACKLIST);
|
provider_done(auth, PROVIDER_BLACKLIST);
|
||||||
|
@ -316,6 +319,9 @@ lookup_all_blacklists(struct auth_client *auth)
|
||||||
struct blacklist_user *bluser = auth->data[PROVIDER_BLACKLIST];
|
struct blacklist_user *bluser = auth->data[PROVIDER_BLACKLIST];
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
|
notice_client(auth->cid, "*** Checking your IP against DNS blacklist%s",
|
||||||
|
rb_dlink_list_length(blacklist_list) > 1 ? "s" : "");
|
||||||
|
|
||||||
RB_DLINK_FOREACH(ptr, blacklist_list.head)
|
RB_DLINK_FOREACH(ptr, blacklist_list.head)
|
||||||
{
|
{
|
||||||
struct blacklist *bl = (struct blacklist *)ptr->data;
|
struct blacklist *bl = (struct blacklist *)ptr->data;
|
||||||
|
@ -358,8 +364,11 @@ blacklists_start(struct auth_client *auth)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(!rb_dlink_list_length(&blacklist_list))
|
if(!rb_dlink_list_length(&blacklist_list))
|
||||||
|
{
|
||||||
/* Nothing to do... */
|
/* Nothing to do... */
|
||||||
|
notice_client(auth->cid, "*** No DNS blacklists configured, not checking your IP");
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
auth->data[PROVIDER_BLACKLIST] = rb_malloc(sizeof(struct blacklist_user));
|
auth->data[PROVIDER_BLACKLIST] = rb_malloc(sizeof(struct blacklist_user));
|
||||||
|
|
||||||
|
@ -400,15 +409,20 @@ blacklists_cancel(struct auth_client *auth)
|
||||||
if(bluser == NULL)
|
if(bluser == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head)
|
if(rb_dlink_list_length(bluser) > 0)
|
||||||
{
|
{
|
||||||
struct blacklist_lookup *bllookup = ptr->data;
|
notice_client(auth->cid, "*** Aborting DNS blacklist queries");
|
||||||
|
|
||||||
cancel_query(bllookup->query);
|
RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head)
|
||||||
unref_blacklist(bllookup->bl);
|
{
|
||||||
|
struct blacklist_lookup *bllookup = ptr->data;
|
||||||
|
|
||||||
rb_dlinkDelete(&bllookup->node, &bluser->queries);
|
cancel_query(bllookup->query);
|
||||||
rb_free(bllookup);
|
unref_blacklist(bllookup->bl);
|
||||||
|
|
||||||
|
rb_dlinkDelete(&bllookup->node, &bluser->queries);
|
||||||
|
rb_free(bllookup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_free(bluser);
|
rb_free(bluser);
|
||||||
|
|
Loading…
Reference in a new issue