]> jfr.im git - solanum.git/blobdiff - modules/m_sasl.c
sasl: remove checks for impossible conditions
[solanum.git] / modules / m_sasl.c
index 451cb4469fd16a70c0708a0d19f6ce9ff697efe0..b17e6bdc0f778404d5e22ab21c16a87bac2f4bf0 100644 (file)
@@ -77,12 +77,6 @@ mr_authenticate(struct Client *client_p, struct Client *source_p,
        if(!IsCapable(source_p, CLICAP_SASL))
                return 0;
 
-       if (strlen(client_p->id) == 3)
-       {
-               exit_client(client_p, client_p, client_p, "Mixing client and server protocol");
-               return 0;
-       }
-
        if(source_p->preClient->sasl_complete)
        {
                sendto_one(source_p, form_str(ERR_SASLALREADY), me.name, EmptyString(source_p->name) ? "*" : source_p->name);
@@ -111,6 +105,7 @@ mr_authenticate(struct Client *client_p, struct Client *source_p,
        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]);
+
        source_p->preClient->sasl_out++;
 
        return 0;
@@ -150,7 +145,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 +156,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 +174,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);