Commit 66b11e7f authored by rswindell's avatar rswindell
Browse files

Let's not generate 40-character random passwords for new users

- that's not nice.
parent 572eac4d
......@@ -232,7 +232,7 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays);
c=0;
while(c<LEN_PASS) { /* Create random password */
while(c < RAND_PASS_LEN) { /* Create random password */
str[c]=sbbs_random(43)+'0';
if(isalnum(str[c]))
c++;
......@@ -261,7 +261,7 @@ bool sbbs_t::logon()
getstr(tmp,LEN_PASS*2,K_UPPER);
console&=~(CON_R_ECHOX|CON_L_ECHOX);
if(strcmp(str,tmp)) {
bputs(text[Wrong]);
bputs(text[Wrong]); // Should be WrongPassword instead?
continue;
}
break;
......
......@@ -367,7 +367,7 @@ BOOL sbbs_t::newuser()
}
else {
c=0;
while(c<LEN_PASS) { /* Create random password */
while(c < RAND_PASS_LEN) { /* Create random password */
useron.pass[c]=sbbs_random(43)+'0';
if(isalnum(useron.pass[c]))
c++;
......
......@@ -528,6 +528,7 @@ typedef enum { /* Values for xtrn_t.event */
#define LEN_MAIN_CMD 34 /* Storage in user.dat for custom commands */
#define LEN_PASS 40
#define MIN_PASS_LEN 4
#define RAND_PASS_LEN 8
#define LEN_SCAN_CMD 35
#define LEN_IPADDR 45
#define LEN_CID 45 /* Caller ID (phone number) */
......
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