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) ...@@ -697,11 +697,11 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
if(strlen(pass)<4) { if(strlen(pass)<4) {
bputs(text[PasswordTooShort]); bputs(text[PasswordTooShort]);
return(0); return(false);
} }
if(!strcmp(pass,user->pass)) { if(!strcmp(pass,user->pass)) {
bputs(text[PasswordNotChanged]); bputs(text[PasswordNotChanged]);
return(0); return(false);
} }
d=strlen(pass); d=strlen(pass);
for(c=1;c<d;c++) for(c=1;c<d;c++)
...@@ -709,21 +709,21 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique) ...@@ -709,21 +709,21 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
break; break;
if(c==d) { if(c==d) {
bputs(text[PasswordInvalid]); bputs(text[PasswordInvalid]);
return(0); return(false);
} }
for(c=0;c<3;c++) /* check for 1234 and ABCD */ for(c=0;c<3;c++) /* check for 1234 and ABCD */
if(pass[c]!=pass[c+1]+1) if(pass[c]!=pass[c+1]+1)
break; break;
if(c==3) { if(c==3) {
bputs(text[PasswordObvious]); bputs(text[PasswordObvious]);
return(0); return(false);
} }
for(c=0;c<3;c++) /* check for 4321 and ZYXW */ for(c=0;c<3;c++) /* check for 4321 and ZYXW */
if(pass[c]!=pass[c+1]-1) if(pass[c]!=pass[c+1]-1)
break; break;
if(c==3) { if(c==3) {
bputs(text[PasswordObvious]); bputs(text[PasswordObvious]);
return(0); return(false);
} }
SAFECOPY(name,user->name); SAFECOPY(name,user->name);
strupr(name); strupr(name);
...@@ -768,9 +768,9 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique) ...@@ -768,9 +768,9 @@ bool sbbs_t::chkpass(char *passwd, user_t* user, bool unique)
) )
{ {
bputs(text[PasswordObvious]); 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