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

Re-generate random password if it doesn't meet our quality standards

Log a message before the regenerate loop, just in case this loops forever. :-)
parent 22e2f74d
No related branches found
No related tags found
No related merge requests found
......@@ -363,6 +363,8 @@ bool sbbs_t::newuser()
else
lprintf(LOG_NOTICE, "Rejected RLogin password for new user");
}
lprintf(LOG_INFO, "Generating a random password for new user");
do {
c = 0;
while (c < MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
useron.pass[c] = sbbs_random(43) + '0';
......@@ -370,6 +372,7 @@ bool sbbs_t::newuser()
c++;
}
useron.pass[c] = 0;
} while (!check_pass(&cfg, useron.pass, &useron, /* unique: */false, /* reason: */NULL));
bprintf(text[YourPasswordIs], useron.pass);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment