From: Chris Porter Date: Sun, 7 Sep 2014 22:06:22 +0000 (+0100) Subject: CHANSERV: block chars < 32 and chars > 127, as users have trouble authing with the... X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/9ca17abdb8ace61cc925cc67950ec1b0bb2dc6d1?hp=d771684794f38e14523b12163ec1d935da00fb1c CHANSERV: block chars < 32 and chars > 127, as users have trouble authing with the website and IRC. --HG-- branch : chanserv-live --- diff --git a/chanserv/authlib.c b/chanserv/authlib.c index 09733b61..6ff0d386 100644 --- a/chanserv/authlib.c +++ b/chanserv/authlib.c @@ -140,6 +140,8 @@ int csa_checkpasswordquality(char *password) { cntdigits++; if(islower(password[i]) || isupper(password[i])) cntletters++; + if(password[i] < 32 || password[i] > 127) + return QM_PWINVALID; } if( cntweak > 3 || !cntdigits || !cntletters) diff --git a/chanserv/chanserv_messages.h b/chanserv/chanserv_messages.h index 4cab1863..9a4d545d 100644 --- a/chanserv/chanserv_messages.h +++ b/chanserv/chanserv_messages.h @@ -249,6 +249,7 @@ BeginMessages() { msg(QM_INACTIVEACCOUNT,"This account has not yet been activated.",""), msg(QM_PWTOLONG, "Sorry, but new password is too long (maximum length 10 chars)", ""), msg(QM_TOOMANYCHANNELS, "User is known on too many channels.", ""), + msg(QM_PWINVALID, "Password contains invalid characters.", ""), } EndMessages() #endif