Skip to content
Snippets Groups Projects
Commit 97d54520 authored by rswindell's avatar rswindell
Browse files

Add support for a password trashcan file (text/password.can) with a custom

optional rejection message file (text/badpassword.msg) - this file is where the
sysop should add common/obvious passwords like "password".
parent 563679e8
No related branches found
No related tags found
No related merge requests found
......@@ -697,11 +697,11 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
if(strlen(pass)<4) {
bputs(text[PasswordTooShort]);
return(0);
return(false);
}
if(!strcmp(pass,user->pass)) {
bputs(text[PasswordNotChanged]);
return(0);
return(false);
}
d=strlen(pass);
for(c=1;c<d;c++)
......@@ -709,21 +709,21 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
break;
if(c==d) {
bputs(text[PasswordInvalid]);
return(0);
return(false);
}
for(c=0;c<3;c++) /* check for 1234 and ABCD */
if(pass[c]!=pass[c+1]+1)
break;
if(c==3) {
bputs(text[PasswordObvious]);
return(0);
return(false);
}
for(c=0;c<3;c++) /* check for 4321 and ZYXW */
if(pass[c]!=pass[c+1]-1)
break;
if(c==3) {
bputs(text[PasswordObvious]);
return(0);
return(false);
}
SAFECOPY(name,user->name);
strupr(name);
......@@ -768,9 +768,9 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
)
{
bputs(text[PasswordObvious]);
return(0);
return(false);
}
return(1);
return(!trashcan(pass,"password"));
}
/****************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment