*
*
* mr_pass - PASS message handler
- * parv[0] = sender prefix
* parv[1] = password
* parv[2] = "TS" if this server supports TS.
* parv[3] = optional TS version field -- needed for TS6
{
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;
}
- client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN);
-
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
if(irccmp(parv[2], "TS") == 0 && client_p->tsinfo == 0)
client_p->tsinfo = TS_DOESTS;
- /* kludge, if we're not using ts6, dont ever mark a server
- * as TS6 capable, that way we'll never send them TS6 data.
- */
if(parc == 5 && atoi(parv[3]) >= 6)
{
/* only mark as TS6 if the SID is valid.. */