]> jfr.im git - solanum.git/blobdiff - modules/m_sasl.c
m_info: Correct description of general::client_exit like in example confs.
[solanum.git] / modules / m_sasl.c
index 451cb4469fd16a70c0708a0d19f6ce9ff697efe0..8dbbf0e7f04926e860a01f1c7af2e58d1688f351 100644 (file)
@@ -106,8 +106,15 @@ mr_authenticate(struct Client *client_p, struct Client *source_p,
                agent_p = find_id(source_p->preClient->sasl_agent);
 
        if(agent_p == NULL)
-               sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s", me.id,
-                               source_p->id, parv[1]);
+       {
+               if (!strcmp(parv[1], "EXTERNAL") && source_p->certfp != NULL)
+                       sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s %s", me.id,
+                                       source_p->id, parv[1],
+                                       source_p->certfp);
+               else
+                       sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s", me.id,
+                                       source_p->id, parv[1]);
+       }
        else
                sendto_one(agent_p, ":%s ENCAP %s SASL %s %s C %s", me.id, agent_p->servptr->name,
                                source_p->id, agent_p->id, parv[1]);
@@ -150,7 +157,7 @@ me_sasl(struct Client *client_p, struct Client *source_p,
        if(*target_p->preClient->sasl_agent && strncmp(parv[1], target_p->preClient->sasl_agent, IDLEN))
                return 0;
        else if(!*target_p->preClient->sasl_agent)
-               strlcpy(target_p->preClient->sasl_agent, parv[1], IDLEN);
+               rb_strlcpy(target_p->preClient->sasl_agent, parv[1], IDLEN);
 
        if(*parv[3] == 'C')
                sendto_one(target_p, "AUTHENTICATE %s", parv[4]);
@@ -161,7 +168,7 @@ me_sasl(struct Client *client_p, struct Client *source_p,
                else if(*parv[4] == 'S') {
                        sendto_one(target_p, form_str(RPL_SASLSUCCESS), me.name, EmptyString(target_p->name) ? "*" : target_p->name);
                        target_p->preClient->sasl_complete = 1;
-                       ServerStats->is_ssuc++;
+                       ServerStats.is_ssuc++;
                }
                *target_p->preClient->sasl_agent = '\0'; /* Blank the stored agent so someone else can answer */
        }
@@ -179,7 +186,7 @@ abort_sasl(struct Client *data)
                return;
 
        data->preClient->sasl_out = data->preClient->sasl_complete = 0;
-       ServerStats->is_sbad++;
+       ServerStats.is_sbad++;
 
        if(!IsClosing(data))
                sendto_one(data, form_str(ERR_SASLABORTED), me.name, EmptyString(data->name) ? "*" : data->name);