blacklist: add notices that we're performing checks.

This commit is contained in:
Elizabeth Myers 2016-03-29 23:22:13 -05:00
parent 4d1e498977
commit 7246347058

View file

@ -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,6 +409,10 @@ blacklists_cancel(struct auth_client *auth)
if(bluser == NULL) if(bluser == NULL)
return; return;
if(rb_dlink_list_length(bluser) > 0)
{
notice_client(auth->cid, "*** Aborting DNS blacklist queries");
RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head) RB_DLINK_FOREACH_SAFE(ptr, nptr, bluser->queries.head)
{ {
struct blacklist_lookup *bllookup = ptr->data; struct blacklist_lookup *bllookup = ptr->data;
@ -410,6 +423,7 @@ blacklists_cancel(struct auth_client *auth)
rb_dlinkDelete(&bllookup->node, &bluser->queries); rb_dlinkDelete(&bllookup->node, &bluser->queries);
rb_free(bllookup); rb_free(bllookup);
} }
}
rb_free(bluser); rb_free(bluser);
auth->data[PROVIDER_BLACKLIST] = NULL; auth->data[PROVIDER_BLACKLIST] = NULL;