Commit 540f62d6 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

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

length... for WitNik.
parent faadb5b9
Pipeline #1055 failed with stage
in 13 minutes and 23 seconds
......@@ -242,7 +242,7 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays);
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';
if(IS_ALPHANUMERIC(str[c]))
c++;
......
......@@ -381,7 +381,7 @@ BOOL sbbs_t::newuser()
}
else {
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';
if(IS_ALPHANUMERIC(useron.pass[c]))
c++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment