]> jfr.im git - solanum.git/blobdiff - modules/m_pass.c
msgbuf: implement msgbuf_parse()
[solanum.git] / modules / m_pass.c
index 0c7636fedb9f534fd6eabee987bc6ab87cd0ee75..e7cc7cd370381455f5cc14124b4e6048aef438ec 100644 (file)
@@ -61,43 +61,30 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
 {
        char *auth_user, *pass, *buf;
        buf = LOCAL_COPY(parv[1]);
-       
-       if(client_p->localClient->passwd)
-       {
-               memset(client_p->localClient->passwd, 0,
-                       strlen(client_p->localClient->passwd));
-               rb_free(client_p->localClient->passwd);
-               client_p->localClient->passwd = NULL;
-       }
 
-       if (client_p->localClient->auth_user)
-       {
-               memset(client_p->localClient->auth_user, 0,
-                      strlen(client_p->localClient->auth_user));
-               rb_free(client_p->localClient->auth_user);
-               client_p->localClient->auth_user = NULL;
-       }
+       if(client_p->localClient->passwd || client_p->localClient->auth_user)
+               return 0;
 
        if ((pass = strchr(buf, ':')) != NULL)
        {
-               *pass++ = '\0'; 
-               auth_user = buf; 
+               *pass++ = '\0';
+               auth_user = buf;
        }
        else
        {
                pass = buf;
                auth_user = NULL;
        }
-       
+
        client_p->localClient->passwd = *pass ? rb_strndup(pass, PASSWDLEN) : NULL;
-       
+
        if(auth_user && *auth_user)
                client_p->localClient->auth_user = rb_strndup(auth_user, PASSWDLEN);
 
        /* These are for servers only */
        if(parc > 2 && client_p->user == NULL)
        {
-               /* 
+               /*
                 * It looks to me as if orabidoo wanted to have more
                 * than one set of option strings possible here...
                 * i.e. ":AABBTS" as long as TS was the last two chars