]> jfr.im git - solanum.git/blobdiff - ircd/authd.c
authd: fix race on the ircd side.
[solanum.git] / ircd / authd.c
index 96d9366694682bb83a906856245b9273dc073d1e..033430709f37cf078753a7603455f2c167c5251a 100644 (file)
@@ -134,12 +134,8 @@ cid_to_client(uint32_t cid, bool delete)
        else
                client_p = rb_dictionary_retrieve(cid_clients, RB_UINT_TO_POINTER(cid));
 
-       if(client_p == NULL)
-       {
-               iwarn("authd sent us back a bad client ID: %ux", cid);
-               restart_authd();
-               return NULL;
-       }
+       /* If the client's not found, that's okay, it may have already gone away.
+        * --Elizafox */
 
        return client_p;
 }
@@ -420,12 +416,12 @@ authd_decide_client(struct Client *client_p, const char *ident, const char *host
        if(*host != '*')
                rb_strlcpy(client_p->host, host, sizeof(client_p->host));
 
+       rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->authd_cid));
+
        client_p->preClient->authd_accepted = accept;
        client_p->preClient->authd_cause = cause;
        client_p->preClient->authd_data = (data == NULL ? NULL : rb_strdup(data));
        client_p->preClient->authd_reason = (reason == NULL ? NULL : rb_strdup(reason));
-
-       rb_dictionary_delete(cid_clients, RB_UINT_TO_POINTER(client_p->preClient->authd_cid));
        client_p->preClient->authd_cid = 0;
 
        /*
@@ -468,8 +464,7 @@ authd_abort_client(struct Client *client_p)
        if(authd_helper != NULL)
                rb_helper_write(authd_helper, "E %x", client_p->preClient->authd_cid);
 
-       /* XXX should we blindly allow like this? */
-       authd_accept_client(client_p, "*", "*");
+       client_p->preClient->authd_accepted = true;
        client_p->preClient->authd_cid = 0;
 }
 
@@ -595,9 +590,9 @@ opm_check_enable(bool enabled)
        rb_helper_write(authd_helper, "O opm_enable %d", enabled ? 1 : 0);
 }
 
-/* Create an OPM proxy scan */
+/* Create an OPM proxy scanner */
 void
-create_opm_proxy_scan(const char *scan, uint16_t port)
+create_opm_proxy_scanner(const char *type, uint16_t port)
 {
-       rb_helper_write(authd_helper, "O opm_scanner %s %hu", scan, port);
+       rb_helper_write(authd_helper, "O opm_scanner %s %hu", type, port);
 }