From 9f928dc532a304f0cc690d580b0637e5386bdebd Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 1 May 2016 10:53:34 +0100 Subject: [PATCH] authd: don't call cancel_providers recursively Also check that they haven't been cancelled while starting up. --- authd/provider.c | 8 ++++++++ authd/provider.h | 1 + 2 files changed, 9 insertions(+) diff --git a/authd/provider.c b/authd/provider.c index 78bade6a..da74496d 100644 --- a/authd/provider.c +++ b/authd/provider.c @@ -182,6 +182,11 @@ auth_client_free(struct auth_client *auth) void cancel_providers(struct auth_client *auth) { + if(auth->providers_cancelled) + return; + + auth->providers_cancelled = true; + if(auth->refcount > 0) { rb_dlink_node *ptr; @@ -323,6 +328,9 @@ start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_ if(!provider->start(auth)) /* Rejected immediately */ return; + + if(auth->providers_cancelled) + break; } auth->providers_starting = false; diff --git a/authd/provider.h b/authd/provider.h index 000c5c0c..34a0b5c3 100644 --- a/authd/provider.h +++ b/authd/provider.h @@ -58,6 +58,7 @@ struct auth_client char username[USERLEN + 1]; /* Used for ident lookup */ bool providers_starting; /* Providers are still warming up */ + bool providers_cancelled; /* Providers are being cancelled */ unsigned int refcount; /* Held references */ struct auth_client_data *data; /* Provider-specific data */