Skip to content
Snippets Groups Projects
Commit 6bcb8227 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

If minimum password length is > 8, use that length for random password

length... for WitNik.
parent 355f9712
No related branches found
No related tags found
No related merge requests found
...@@ -242,7 +242,7 @@ bool sbbs_t::logon() ...@@ -242,7 +242,7 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays); bprintf(text[TimeToChangePw],cfg.sys_pwdays);
c=0; c=0;
while(c < RAND_PASS_LEN) { /* Create random password */ while(c < max(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
str[c]=sbbs_random(43)+'0'; str[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(str[c])) if(IS_ALPHANUMERIC(str[c]))
c++; c++;
......
...@@ -381,7 +381,7 @@ BOOL sbbs_t::newuser() ...@@ -381,7 +381,7 @@ BOOL sbbs_t::newuser()
} }
else { else {
c=0; c=0;
while(c < RAND_PASS_LEN) { /* Create random password */ while(c < max(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
useron.pass[c]=sbbs_random(43)+'0'; useron.pass[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(useron.pass[c])) if(IS_ALPHANUMERIC(useron.pass[c]))
c++; c++;
......
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