Commit ee5df622 authored by rswindell's avatar rswindell
Browse files

Extend the maximum user password length from 8 to 40 characters.

parent dcdf73c1
......@@ -515,7 +515,7 @@ typedef enum { /* Values for xtrn_t.event */
#define LEN_COMP 30 /* User computer description */
#define LEN_COMMENT 60 /* User comment */
#define LEN_NETMAIL 60 /* NetMail forwarding address */
#define LEN_PASS 8 /* User password */
#define LEN_OLDPASS 8 /* User password (old) */
#define LEN_PHONE 12 /* User phone number */
#define LEN_BIRTH 8 /* Birthday in MM/DD/YY format */
#define LEN_ADDRESS 30 /* User address */
......@@ -526,9 +526,10 @@ typedef enum { /* Values for xtrn_t.event */
#define LEN_FCDT 9 /* 9 digits for file credit values */
#define LEN_TITLE 70 /* Message title */
#define LEN_MAIN_CMD 34 /* Storage in user.dat for custom commands */
#define LEN_XFER_CMD 40
#define LEN_PASS 40
#define MIN_PASS_LEN 4
#define LEN_SCAN_CMD 35
#define LEN_IPADDR 45
#define LEN_IPADDR 45
#define LEN_CID 45 /* Caller ID (phone number) */
#define LEN_ARSTR 40 /* Max length of Access Requirement string */
#define LEN_CHATACTCMD 9 /* Chat action command */
......@@ -551,8 +552,8 @@ typedef enum { /* Values for xtrn_t.event */
#define U_LOCATION U_ADDRESS+LEN_ADDRESS
#define U_ZIPCODE U_LOCATION+LEN_LOCATION
#define U_PASS U_ZIPCODE+LEN_ZIPCODE+2
#define U_PHONE U_PASS+8 /* Offset to phone-number */
#define U_OLDPASS U_ZIPCODE+LEN_ZIPCODE+2
#define U_PHONE U_OLDPASS+LEN_OLDPASS /* Offset to phone-number */
#define U_BIRTH U_PHONE+12 /* Offset to users birthday */
#define U_MODEM U_BIRTH+8
#define U_LASTON U_MODEM+8
......@@ -593,8 +594,8 @@ typedef enum { /* Values for xtrn_t.event */
#define U_CURSUB U_LEECH+2 /* Current sub (internal code) */
#define U_CURXTRN U_CURSUB+16 /* Current xtrn (internal code) */
#define U_MAIN_CMD U_CURXTRN+8+2 /* unused */
#define U_XFER_CMD U_MAIN_CMD+LEN_MAIN_CMD /* unused */
#define U_SCAN_CMD U_XFER_CMD+LEN_XFER_CMD+2 /* unused */
#define U_PASS U_MAIN_CMD+LEN_MAIN_CMD
#define U_SCAN_CMD U_PASS+LEN_PASS+2 /* unused */
#define U_IPADDR U_SCAN_CMD+LEN_SCAN_CMD /* unused */
#define U_FREECDT U_IPADDR+LEN_IPADDR+2
#define U_FLAGS3 U_FREECDT+10 /* Flag set #3 */
......
......@@ -296,6 +296,8 @@ int parseuserdat(scfg_t* cfg, char *userdat, user_t *user)
getrec(userdat,U_LOCATION,LEN_LOCATION,user->location);
getrec(userdat,U_ZIPCODE,LEN_ZIPCODE,user->zipcode);
getrec(userdat,U_PASS,LEN_PASS,user->pass);
if(user->pass[0] == 0) // Backwards compatibility hack
getrec(userdat, U_OLDPASS, LEN_OLDPASS, user->pass);
getrec(userdat,U_PHONE,LEN_PHONE,user->phone);
getrec(userdat,U_BIRTH,LEN_BIRTH,user->birth);
getrec(userdat,U_MODEM,LEN_MODEM,user->modem);
......@@ -530,6 +532,7 @@ int putuserdat(scfg_t* cfg, user_t* user)
putrec(userdat,U_ZIPCODE+LEN_ZIPCODE,2,crlf);
putrec(userdat,U_PASS,LEN_PASS,user->pass);
putrec(userdat,U_OLDPASS,LEN_OLDPASS,user->pass); // So a sysop can downgrade to a previous build/version
putrec(userdat,U_PHONE,LEN_PHONE,user->phone);
putrec(userdat,U_BIRTH,LEN_BIRTH,user->birth);
putrec(userdat,U_MODEM,LEN_MODEM,user->modem);
......@@ -580,7 +583,7 @@ int putuserdat(scfg_t* cfg, user_t* user)
putrec(userdat,U_CURXTRN,8,user->curxtrn);
putrec(userdat,U_CURXTRN+8,2,crlf);
putrec(userdat,U_XFER_CMD+LEN_XFER_CMD,2,crlf);
putrec(userdat,U_PASS+LEN_PASS, 2, crlf);
putrec(userdat,U_IPADDR+LEN_IPADDR,2,crlf);
......@@ -2104,6 +2107,9 @@ int getuserrec(scfg_t* cfg, int usernumber,int start, int length, char *str)
if(str[c]==ETX || str[c]==CR) break;
str[c]=0;
if(c == 0 && start == LEN_PASS) // Backwards compatibility hack
return getuserrec(cfg, usernumber, U_OLDPASS, LEN_OLDPASS, str);
return(0);
}
......
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