]> jfr.im git - solanum.git/blobdiff - modules/m_pass.c
strcpy: mass-migrate to strlcpy where appropriate
[solanum.git] / modules / m_pass.c
index 9dc36c067621133b48284973c31bd8141f7cdd88..36398055e3a0a1a903d944e05f75197707f0cf06 100644 (file)
@@ -35,7 +35,9 @@
 #include "hash.h"
 #include "s_conf.h"
 
-static int mr_pass(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char pass_desc[] = "Provides the PASS command to authenticate clients and servers";
+
+static void mr_pass(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message pass_msgtab = {
        "PASS", 0, 0, 0, 0,
@@ -43,7 +45,8 @@ struct Message pass_msgtab = {
 };
 
 mapi_clist_av1 pass_clist[] = { &pass_msgtab, NULL };
-DECLARE_MODULE_AV2(pass, NULL, NULL, pass_clist, NULL, NULL, NULL, NULL, NULL);
+
+DECLARE_MODULE_AV2(pass, NULL, NULL, pass_clist, NULL, NULL, NULL, NULL, pass_desc);
 
 /*
  * m_pass() - Added Sat, 4 March 1989
@@ -54,14 +57,14 @@ DECLARE_MODULE_AV2(pass, NULL, NULL, pass_clist, NULL, NULL, NULL, NULL, NULL);
  *      parv[2] = "TS" if this server supports TS.
  *      parv[3] = optional TS version field -- needed for TS6
  */
-static int
+static void
 mr_pass(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        char *auth_user, *pass, *buf;
        buf = LOCAL_COPY(parv[1]);
 
        if(client_p->localClient->passwd || client_p->localClient->auth_user)
-               return 0;
+               return;
 
        if ((pass = strchr(buf, ':')) != NULL)
        {
@@ -101,10 +104,8 @@ mr_pass(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
                           EmptyString(client_p->id))
                        {
                                client_p->localClient->caps |= CAP_TS6;
-                               strcpy(client_p->id, parv[4]);
+                               rb_strlcpy(client_p->id, parv[4], sizeof(client_p->id));
                        }
                }
        }
-
-       return 0;
 }