char *authtype = "AUTH";
authname *anp;
int toomanyauths=0;
+ time_t now;
if (alg) {
challenge=1;
if (toomanyauths)
return CMD_ERROR;
- rup->lastauth=time(NULL);
+ /* Guarantee a unique auth timestamp for each account */
+ now=time(NULL);
+ if (rup->lastauth < now)
+ rup->lastauth=now;
+ else
+ rup->lastauth++;
+
sprintf(userhost,"%s@%s",sender->ident,sender->host->name->content);
if (rup->lastuserhost)
freesstring(rup->lastuserhost);
chanservstdmessage(sender, QM_AUTHOK, rup->username);
cs_log(sender,"%s OK username %s", authtype,rup->username);
- localusersetaccountwithuserid(sender, rup->username, rup->ID);;
+ localusersetaccountwithuseridts(sender, rup->username, rup->ID, rup->lastauth);
return CMD_OK;
}