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 */