Made bbs menus machine endian indepentant

This commit is contained in:
Michiel Broek
2003-02-12 20:56:57 +00:00
parent 8def403243
commit e4c4477ad3
11 changed files with 55 additions and 105 deletions

View File

@@ -501,7 +501,7 @@ void name_mangle(char *); /* Mangle name or make uppercase */
* sectest.c
*/
int Access(securityrec, securityrec); /* Check security access */
int Le_Access(securityrec, securityrec); /* Endian independant */
#endif

View File

@@ -4,7 +4,7 @@
* Purpose ...............: Security flags access test
*
*****************************************************************************
* Copyright (C) 1997-2002
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -55,3 +55,27 @@ int Access(securityrec us, securityrec ref)
return TRUE;
}
/*
* The same test, for menus which are written in machine endian independant way.
* The second parameter MUST be the menu parameter.
*/
int Le_Access(securityrec us, securityrec ref)
{
Syslog('B', "User %5d %08lx %08lx", us.level, us.flags, ~us.flags);
Syslog('B', "Ref. %5d %08lx %08lx", le_int(ref.level), ref.flags, ref.notflags);
if (us.level < le_int(ref.level))
return FALSE;
if ((ref.notflags & ~us.flags) != ref.notflags)
return FALSE;
if ((ref.flags & us.flags) != ref.flags)
return FALSE;
return TRUE;
}

View File

@@ -4,7 +4,7 @@
* Purpose ...............: MBSE BBS Global structure
*
*****************************************************************************
* Copyright (C) 1997-2002
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -839,16 +839,16 @@ struct menufile {
char Display[81]; /* Menu display line */
securityrec MenuSecurity; /* Menu Security Level */
int Age; /* Minimum Age to use menu */
unsigned int MaxSecurity; /* Maximum security level */
unsigned int xMaxSecurity;
char Password[15]; /* Menu Password */
char TypeDesc[30]; /* Menu Type Description */
unsigned AutoExec : 1; /* Auto Exec Menu Type */
unsigned NoDoorsys : 1; /* Suppress door.sys */
unsigned Y2Kdoorsys : 1; /* Write Y2K style door.sys */
unsigned Comport : 1; /* Vmodem compart mode */
unsigned Comport : 1; /* Vmodem comport mode */
unsigned NoSuid : 1; /* Execute door nosuid */
unsigned NoPrompt : 1; /* No prompt after door */
long Credit; /* Credit needed */
long xCredit;
int HiForeGnd; /* High ForeGround color */
int HiBackGnd; /* High ForeGround color */
int ForeGnd; /* Normal ForeGround color */