Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -232,7 +232,7 @@ bool sbbs_t::logon() ...@@ -232,7 +232,7 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays); bprintf(text[TimeToChangePw],cfg.sys_pwdays);
c=0; c=0;
while(c<LEN_PASS) { /* Create random password */ while(c < RAND_PASS_LEN) { /* Create random password */
str[c]=sbbs_random(43)+'0'; str[c]=sbbs_random(43)+'0';
if(isalnum(str[c])) if(isalnum(str[c]))
c++; c++;
...@@ -261,7 +261,7 @@ bool sbbs_t::logon() ...@@ -261,7 +261,7 @@ bool sbbs_t::logon()
getstr(tmp,LEN_PASS*2,K_UPPER); getstr(tmp,LEN_PASS*2,K_UPPER);
console&=~(CON_R_ECHOX|CON_L_ECHOX); console&=~(CON_R_ECHOX|CON_L_ECHOX);
if(strcmp(str,tmp)) { if(strcmp(str,tmp)) {
bputs(text[Wrong]); bputs(text[Wrong]); // Should be WrongPassword instead?
continue; continue;
} }
break; break;
......
...@@ -367,7 +367,7 @@ BOOL sbbs_t::newuser() ...@@ -367,7 +367,7 @@ BOOL sbbs_t::newuser()
} }
else { else {
c=0; c=0;
while(c<LEN_PASS) { /* Create random password */ while(c < RAND_PASS_LEN) { /* Create random password */
useron.pass[c]=sbbs_random(43)+'0'; useron.pass[c]=sbbs_random(43)+'0';
if(isalnum(useron.pass[c])) if(isalnum(useron.pass[c]))
c++; c++;
......
...@@ -528,6 +528,7 @@ typedef enum { /* Values for xtrn_t.event */ ...@@ -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_MAIN_CMD 34 /* Storage in user.dat for custom commands */
#define LEN_PASS 40 #define LEN_PASS 40
#define MIN_PASS_LEN 4 #define MIN_PASS_LEN 4
#define RAND_PASS_LEN 8
#define LEN_SCAN_CMD 35 #define LEN_SCAN_CMD 35
#define LEN_IPADDR 45 #define LEN_IPADDR 45
#define LEN_CID 45 /* Caller ID (phone number) */ #define LEN_CID 45 /* Caller ID (phone number) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment