From 97d54520886d84202274066ec0a1efe4f156483c Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 25 Aug 2011 07:56:25 +0000
Subject: [PATCH] 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".

---
 src/sbbs3/str.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/sbbs3/str.cpp b/src/sbbs3/str.cpp
index fb020ce872..68736998cc 100644
--- a/src/sbbs3/str.cpp
+++ b/src/sbbs3/str.cpp
@@ -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"));
 }
 
 /****************************************************************************/
-- 
GitLab