From f5586c3abb392a7a14c35c8ac2968c179b91182b Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Sat, 26 Mar 2016 19:50:09 -0500 Subject: [PATCH] authd: misc provider fixes --- authd/authd.c | 2 +- authd/provider.c | 1 + authd/providers/blacklist.c | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/authd/authd.c b/authd/authd.c index c6ed0911c..f2b051907 100644 --- a/authd/authd.c +++ b/authd/authd.c @@ -88,7 +88,7 @@ handle_options(int parc, char *parv[]) return; } - handler->handler(parv[1], parc - 2, (const char **)(parv + 3)); + handler->handler(parv[1], parc - 2, (const char **)&parv[2]); } static void diff --git a/authd/provider.c b/authd/provider.c index d048ae7ae..c92fea26a 100644 --- a/authd/provider.c +++ b/authd/provider.c @@ -96,6 +96,7 @@ void init_providers(void) auth_clients = rb_dictionary_create("pending auth clients", rb_uint32cmp); load_provider(&rdns_provider); load_provider(&ident_provider); + load_provider(&blacklist_provider); } /* Terminate all providers */ diff --git a/authd/providers/blacklist.c b/authd/providers/blacklist.c index 768d6b327..7c59facc4 100644 --- a/authd/providers/blacklist.c +++ b/authd/providers/blacklist.c @@ -435,10 +435,13 @@ blacklists_destroy(void) static void add_conf_blacklist(const char *key, int parc, const char **parv) { - rb_dlink_list filters; + rb_dlink_list filters = { NULL, NULL, 0 }; char *tmp, *elemlist = rb_strdup(parv[2]); unsigned char iptype; + if(*elemlist == '*') + goto end; + for(char *elem = rb_strtok_r(elemlist, ",", &tmp); elem; elem = rb_strtok_r(NULL, ",", &tmp)) { struct blacklist_filter *filter = rb_malloc(sizeof(struct blacklist_filter)); @@ -485,6 +488,7 @@ add_conf_blacklist(const char *key, int parc, const char **parv) rb_dlinkAdd(filter, &filter->node, &filters); } +end: rb_free(elemlist); iptype = atoi(parv[1]) & 0x3;