reguser *ruh;
int found=0;
char *dupemail;
+ activeuser *aup;
if (getreguserfromnick(sender))
return CMD_ERROR;
return CMD_ERROR;
}
+ if (!(aup = getactiveuserfromnick(sender)))
+ return CMD_ERROR;
+
+ if (aup->helloattempts > MAXHELLOS) {
+ chanservstdmessage(sender, QM_MAXHELLOLIMIT);
+ return CMD_ERROR;
+ }
+
if (strcmp(cargv[0],cargv[1])) {
chanservstdmessage(sender, QM_EMAILDONTMATCH);
cs_log(sender,"HELLO FAIL username %s email don't match (%s vs %s)",sender->nick,cargv[0],cargv[1]);
}
}
+ aup->helloattempts++;
+
dupemail = strdup(cargv[0]);
local=strchr(dupemail, '@');
*(local++)='\0';
/* Maximum number of times a user may attempt to auth */
#define MAXAUTHATTEMPT 3
+/* Maximum number of hellos in a session */
+#define MAXHELLOS 3
+
/* Maximum number of times a user may actually be authed */
#define MAXAUTHCOUNT 2
#define QM_TOOMANYCHANLEVS 154
#define QM_TOOMANYBANS 155
#define QM_WARNNOTREMOVEDPERMBAN 156
+#define QM_MAXHELLOLIMIT 157
/* List of privileged operations */
#ifdef CS_PARANOID
unsigned int activeuser_magic;
#endif
- int authattempts; /* number of times user has attempted to auth */
-
+ unsigned short authattempts; /* number of times user has attempted to auth */
+ unsigned short helloattempts; /* number of times user has attempted to hello... */
unsigned char entropy[ENTROPYLEN]; /* entropy used for challengeauth */
time_t entropyttl;
struct activeuser *next; /* purely for keeping track of free, but not free'd structures */
tagactiveuser(aup);
aup->authattempts=0;
+ aup->helloattempts=0;
aup->entropyttl=0;
return aup;
/* 154*/ "Channel has too many user entries, aborting.",
/* 155*/ "Channel has too many bans set, aborting.",
/* 156*/ "Warning: not removing registered ban %s from %s.",
+ /* 157*/ "Sorry, the registration service is unavailable to you at this time. Please try again later.", /* a deliberately vague message */
};
void initmessages() {