Commit 6ddae40a authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix EXITINFO.BBS generation for 64-bit time_t and more

So I was working on re-writing some of this door file generation code and noticed that the EXITINFO.BBS files generated by SBBS:

1. had a lot of garbage data filling unused string characters (no "harm", but potentially leaking information)
2. had the wrong total file length due to 64-bit logontime (time_t)
3. had the wrong total file length due to writing 19 GosubData elements (instead of 20)

The first and last issues appear to be some of those "forever" (20+ year old) bugs.

So I'm guessing no regularly used door games actually use these portions of the EXITINFO.BBS, so most likely: no harm, no foul. But still, best to fix this before I commit the rewrite.
parent 4280408d
Pipeline #2856 passed with stage
in 9 minutes and 43 seconds
...@@ -545,18 +545,19 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl ...@@ -545,18 +545,19 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC); errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
return; return;
} }
char blank[256]{};
w=(WORD)dte_rate; w=(WORD)dte_rate;
write(file,&w,sizeof(w)); /* BaudRate */ write(file,&w,sizeof(w)); /* BaudRate */
/* SysInfo */ /* SysInfo */
getstats(&cfg,0,&stats); getstats(&cfg,0,&stats);
write(file,&stats.logons,sizeof(stats.logons)); /* CallCount */ write(file,&stats.logons,sizeof(stats.logons)); /* CallCount */
write(file,nulstr,36); /* LastCallerName */ write(file,blank,36); /* LastCallerName */
write(file,nulstr,36); /* LastCallerAlias */ write(file,blank,36); /* LastCallerAlias */
write(file,nulstr,92); /* ExtraSpace */ write(file,blank,92); /* ExtraSpace */
/* TimeLogInfo */ /* TimeLogInfo */
write(file,nulstr,9); /* StartDate */ write(file,blank,9); /* StartDate */
write(file,nulstr,24*sizeof(int16_t)); /* BusyPerHour */ write(file,blank,24*sizeof(int16_t)); /* BusyPerHour */
write(file,nulstr,7*sizeof(int16_t)); /* BusyPerDay */ write(file,blank,7*sizeof(int16_t)); /* BusyPerDay */
/* UserInfo */ /* UserInfo */
str2pas(name,str); /* Name */ str2pas(name,str); /* Name */
write(file,str,36); write(file,str,36);
...@@ -636,7 +637,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl ...@@ -636,7 +637,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
str2pas(tmp,str); str2pas(tmp,str);
write(file,str,9); /* LoginDate */ write(file,str,9); /* LoginDate */
write(file,&cfg.level_timepercall[useron.level],sizeof(int16_t)); /* TmLimit */ write(file,&cfg.level_timepercall[useron.level],sizeof(int16_t)); /* TmLimit */
write(file,&logontime,sizeof(logontime)); /* LoginSec */ write(file,&logontime,sizeof(time32_t)); /* LoginSec */
write(file,&useron.cdt,sizeof(useron.cdt)); /* Credit */ write(file,&useron.cdt,sizeof(useron.cdt)); /* Credit */
write(file,&useron.number,sizeof(useron.number)); /* UserRecNum */ write(file,&useron.number,sizeof(useron.number)); /* UserRecNum */
i=0; i=0;
...@@ -649,7 +650,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl ...@@ -649,7 +650,7 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
write(file,&c,1); /* GosubLevel */ write(file,&c,1); /* GosubLevel */
memset(str,0,255); memset(str,0,255);
for(i=1;i<20;i++) for(i=0;i<20;i++)
write(file,str,9); /* GosubData */ write(file,str,9); /* GosubData */
write(file,str,9); /* Menu */ write(file,str,9); /* Menu */
c=useron.misc&CLRSCRN ? 1:0; c=useron.misc&CLRSCRN ? 1: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