From e4c4477ad33d8c24794ce3b0106324cb6928ebc4 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Wed, 12 Feb 2003 20:56:57 +0000 Subject: [PATCH] Made bbs menus machine endian indepentant --- ChangeLog | 4 ++- examples/Makefile | 22 +++++---------- examples/endian.c | 64 ------------------------------------------ examples/endian.h | 4 --- examples/menus-be.tar | Bin 61440 -> 0 bytes examples/menus-en.tar | Bin 61440 -> 61440 bytes examples/menus-le.tar | Bin 61440 -> 0 bytes lib/common.h | 2 +- lib/sectest.c | 26 ++++++++++++++++- lib/structs.h | 8 +++--- mbsebbs/menu.c | 30 ++++++++++---------- 11 files changed, 55 insertions(+), 105 deletions(-) delete mode 100644 examples/endian.c delete mode 100644 examples/endian.h delete mode 100644 examples/menus-be.tar delete mode 100644 examples/menus-le.tar diff --git a/ChangeLog b/ChangeLog index 95d025dc..4f9cb182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ $Id$ - WARNING, users of Sparc and HP-PA systems should not edit bbs menus now! + WARNING, users of Sparc and HP-PA systems should be carefull, some + menus might not work. All other users on Intel machines (99,9% I think) can use this version. @@ -106,6 +107,7 @@ v0.37.01 14-Jan-2003. Fixed whoson list to display user real names and handles again. Fixed send online message to send to user real names, handles and unix names again. + The menus are machine endian independant. examples: The English and Dutch templates are updated to show the new diff --git a/examples/Makefile b/examples/Makefile index 0b56b4eb..7adff458 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -3,13 +3,9 @@ include ../Makefile.global -SRCS = endian.c -HDRS = endian.h -OBJS = endian.o -OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \ - txtfiles-en.tar templates-en.tar \ +OTHER = Makefile header.txt footer.txt \ + menus-en.tar txtfiles-en.tar templates-en.tar \ menus-es.tar txtfiles-es.tar templates-es.tar \ - menus-en.tar \ templates-de.tar \ templates-nl.tar @@ -18,13 +14,10 @@ OTHER = Makefile header.txt footer.txt menus-le.tar menus-be.tar \ .c.o: ${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $< -all: endian +all: -endian: ${OBJS} ${LIBS} - ${CC} -o endian ${OBJS} ${LIBS} - strip endian -install: all +install: @if [ ! -f ${ETCDIR}/header.txt ]; then \ ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 header.txt ${ETCDIR} ; \ echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 header.txt ${ETCDIR}" ; \ @@ -34,8 +27,8 @@ install: all echo "${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0644 footer.txt ${ETCDIR}" ; \ fi @if [ ! -f ${PREFIX}/english/menus/main.mnu ]; then \ - tar xfC menus-`./endian`.tar ${PREFIX}/english/menus ; \ - echo "tar xfC menus-`./endian`.tar ${PREFIX}/english/menus" ; \ + tar xfC menus-en.tar ${PREFIX}/english/menus ; \ + echo "tar xfC menus-en.tar ${PREFIX}/english/menus" ; \ echo "Installed default English menus" ; \ fi @if [ ! -f ${PREFIX}/english/txtfiles/main.ans ]; then \ @@ -69,7 +62,7 @@ install: all fi clean: - rm -f endian *.o *.h~ *.c~ core filelist Makefile.bak + rm -f *.h~ *.c~ core filelist Makefile.bak filelist: Makefile BASE=`pwd`; \ @@ -100,5 +93,4 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -endian.o: endian.h # End of generated dependencies diff --git a/examples/endian.c b/examples/endian.c deleted file mode 100644 index 7a40a2e0..00000000 --- a/examples/endian.c +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * - * $Id$ - * Purpose ...............: Check little/big-endian for install of the menus. - * - ***************************************************************************** - * Copyright (C) 1997-2002 - * - * Michiel Broek FIDO: 2:280/2802 - * Beekmansbos 10 - * 1971 BV IJmuiden - * the Netherlands - * - * This file is part of MBSE BBS. - * - * This BBS is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * MB BBS is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with MB BBS; see the file COPYING. If not, write to the Free - * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - *****************************************************************************/ - - -#include -#include -#include "endian.h" - -int main(void) -{ - - /* - * First test BYTE_ORDER - */ -#ifdef BYTE_ORDER - if (BYTE_ORDER == 1234) { - printf("le"); - } else if (BYTE_ORDER == 4321) { - printf("be"); - } else { - /* - * If it failed do a simple CPU test - */ -#endif -#ifdef __i386__ - printf("le"); -#else - printf("be"); -#endif -#ifdef BYTE_ORDER - } -#endif - - - return 0; -} - diff --git a/examples/endian.h b/examples/endian.h deleted file mode 100644 index 1a8c5fda..00000000 --- a/examples/endian.h +++ /dev/null @@ -1,4 +0,0 @@ -/* $Id$ */ - -int main(void); - diff --git a/examples/menus-be.tar b/examples/menus-be.tar deleted file mode 100644 index 6c207377777c5074785929def42222ff92d0c7ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61440 zcmeHQX>a4W8J4qkr|9mY2evKxjRO?eqe#ZL+v%~*WR5O&(#gb`ofbu>pl#Y#V~d6) zPc|P~?EZuve`AKG7s%%8Xp=>cxi=ia0}7tzaMs+jq2;h(~Y+D__^|GC7hF!2HRIiU{s z2h1fn0pxYx#3EZm-sioZ=J+4rcrOS48KQq>j}C{n(*dmO+gIQCsOWWLRvI6w~({lDW%Xp{HQ_Iw=r*VVVBI86%w(*|K2p)E$;&OnU2 z>H>HV(f=o|Qf=~D1AemX!e0OmpO}`#D1>SjA7D{nhzL zi#fplI)pphFp(Loe9r@MKpdnem?@-xaiz4#i{5w>52Rj07fRe@pQmn z_ef{ry3Fy1r_mgUqkJze^V;QIR&&gU*yY?!TLUQJ|7y)T@O**(uT}*GA@G0AYSZw4 z^G7U&)FRG;6za{k%IJw`_`l2A&$%3s7#_p_WjjmL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6RAj{atV{vpS+77~rA>P>19ac0nq zsz0OJK(5P0&-^2J^pQu-@N|aS55s>E`Wt7t8>{m_>jCq_^nmFB(*vdlOb?hIFg;*; z!1RFW0n-Df2TTu`9xy#%dcgF6=>gLNrUy(9m>w`aV0ysxfaw9#1EvQ|511afHa+lv Dl-4#; diff --git a/examples/menus-en.tar b/examples/menus-en.tar index 8d2ca7c2109d24ab7316fe676e2383b03da8f15b..278282c9a0eda2703ffe4b1bc36268c57d8d2982 100644 GIT binary patch delta 658 zcmZp8z})bFc|tz7p}DCMg8>j2noO*cV>LBrP%xPMkvnBGBV!&fvh3t4J~>t+6Sy>g zCajS;3NqI)qwL?}5zTOtfq@}Z7Z~1$ zC-0r8Jo(x#0ghORpf<7~yCYc84=8p7sL*)xo5^2TnZp?FPX6d}a`FZX7Oupi)I^1% z(wx-diGm^^b0%AqpPIxIGierD@Xi8y!2ljUv-1S?u*9FCiLoItE+O$}Xk=y#jz6G> zU}xb9%t;0M2nZ&h-zC2J$!;00$qwa*CMq~g RI)>(sW5AF`#MANrDgYF6xn2MO delta 618 zcmZp8z})bFc|tz7fw`F(g8>kjn@y~eV>LHsP%xPMkvnBGBV!&fvh3t4J~>ts1GqGQ zCa?2n{sM#M~4pXJ%$#WMpD)ZVnVTG&C|bf@_xj$jIVy1HX{RsA1(7lQRV%Bel&z@_s`=;m5u{SBTSD+ z51|}6R#Sv@ZXP?T?h=#$EX@?e9f0QMz@UZ(pplue5hwr+Oike~Yk$kh?8tBu6f%?d z_8V`0G5HJYLEjDkuR&p diff --git a/examples/menus-le.tar b/examples/menus-le.tar deleted file mode 100644 index 278282c9a0eda2703ffe4b1bc36268c57d8d2982..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61440 zcmeHQS##US5$>Fu$|jYgl83yFt5UVQPEi6+?0OwLk|=v!E3aizvXk0cr9g5>A_6fi z9MQqQbg;*E1YKVAOGG zcx~Qir{m7Mod0W|K?sEa*EHR+Wn7ZI`}axTv?#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FETk2a0TYL~C~Sz%7_yZO?t z>6e>9R+#AhKdq`a(EnSnHENnxsW*iGcLm+R)&5^5eM0R2@m`QgYbiF8VE?ZSuOLC+ ze7xU2{C?}nlat+!Y446YBRTD2Ar=z+oxOinKKtMdf3$p?ynM9_+v7KQ6PVNx5A!oD zK24%Ye8i7ObcZxd3mxi)uTCne2=oH8J8MITY%BWa6n!N?-^LwwZl}2-B>MRzcN3sb z$^Uzbz7(K8cIXR}`M5Vh?Uc@6mDv3ZWgq4}zYVGEeooQf4$wbF5Azg}^S&aH{eBjG zO8Gyg=x+t+kJtc1Ym#(m>1QN%KWEVcd|kTw4KEmu`6oE^kteowd4pcD5)RSxkv{m_ zW}lCc2kKLCKyg5EKyg5EKyg5EKyg5EKyg5EKyg5EKyg5EKyg5EKyg5EKyg5EKyg5E OKyg5EKyjdW9QYr3`eWMw diff --git a/lib/common.h b/lib/common.h index c008e08a..0fad6f4a 100644 --- a/lib/common.h +++ b/lib/common.h @@ -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 diff --git a/lib/sectest.c b/lib/sectest.c index abfe46aa..40eef1f9 100644 --- a/lib/sectest.c +++ b/lib/sectest.c @@ -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; +} + + diff --git a/lib/structs.h b/lib/structs.h index 9e5cfdc8..f9796f06 100644 --- a/lib/structs.h +++ b/lib/structs.h @@ -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 */ diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index 648fb152..63ae225b 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -147,8 +147,8 @@ void menu() */ IsANSI = FALSE; while (fread(&menus, sizeof(menus), 1, pMenuFile) == 1) { - if ( Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= menus.Age)){ - if ((menus.MenuType == 5) || (menus.MenuType == 19) || (menus.MenuType == 20)) + if ( Le_Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= le_int(menus.Age))){ + if ((le_int(menus.MenuType) == 5) || (le_int(menus.MenuType) == 19) || (le_int(menus.MenuType) == 20)) IsANSI = TRUE; } } @@ -157,9 +157,9 @@ void menu() clear(); while (fread(&menus, sizeof(menus), 1, pMenuFile) == 1) { - if ( Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= menus.Age)){ + if ( Le_Access(exitinfo.Security, menus.MenuSecurity) && (UserAge >= le_int(menus.Age))){ if ( menus.AutoExec ) { - DoMenu( menus.MenuType ); + DoMenu( le_int(menus.MenuType) ); } DisplayMenu( ); } @@ -224,10 +224,10 @@ void menu() while (fread(&menus, sizeof(menus), 1, pMenuFile) == 1) { if ((strcmp(tu(Input), menus.MenuKey)) == 0) { - if ((Access(exitinfo.Security, menus.MenuSecurity)) && (UserAge >= menus.Age)) { - Syslog('b', "Menu[%d] %d=(%s), Opt: '%s'", MenuLevel, menus.MenuType, + if ((Le_Access(exitinfo.Security, menus.MenuSecurity)) && (UserAge >= le_int(menus.Age))) { + Syslog('b', "Menu[%d] %d=(%s), Opt: '%s'", MenuLevel, le_int(menus.MenuType), menus.TypeDesc, menus.OptionalData); - if (menus.MenuType == 13) { + if (le_int(menus.MenuType) == 13) { /* * Terminate call, cleanup here */ @@ -235,7 +235,7 @@ void menu() free(sMenuPathFileName); fclose(pMenuFile); } - DoMenu(menus.MenuType); + DoMenu(le_int(menus.MenuType)); iFoundKey = TRUE; break; } @@ -321,8 +321,8 @@ void DoMenu(int Type) strcat(sPrompt, temp); } } - if (menus.ForeGnd || menus.BackGnd) - pout(menus.ForeGnd, menus.BackGnd, sPrompt); + if (le_int(menus.ForeGnd) || le_int(menus.BackGnd)) + pout(le_int(menus.ForeGnd), le_int(menus.BackGnd), sPrompt); else pout(WHITE, BLACK, sPrompt); break; @@ -372,7 +372,7 @@ void DoMenu(int Type) case 15: /* print text to screen */ - if (exitinfo.Security.level >= menus.MenuSecurity.level) { + if (exitinfo.Security.level >= le_int(menus.MenuSecurity.level)) { for (i = 0; i < strlen(menus.OptionalData); i++) if (*(menus.OptionalData + i) == '@') *(menus.OptionalData + i) = '\n'; @@ -713,7 +713,7 @@ void DisplayMenu(void) int maxdpos, dpos, escaped, skipCRLF, highlight; /* Anything to process, if not; save CPU time, return */ - if (( strlen( menus.Display ) == 0 ) && (menus.MenuType != 21)) { + if (( strlen( menus.Display ) == 0 ) && (le_int(menus.MenuType) != 21)) { return; } @@ -724,7 +724,7 @@ void DisplayMenu(void) skipCRLF = 0; highlight = 0; - colour( menus.ForeGnd, menus.BackGnd ); + colour( le_int(menus.ForeGnd), le_int(menus.BackGnd) ); for ( dpos = 0; dpos < maxdpos ; dpos++ ){ switch ( menus.Display[ dpos ] ) { @@ -749,10 +749,10 @@ void DisplayMenu(void) if ( !escaped ) { if ( highlight == 0 ) { highlight = 1; - colour( menus.HiForeGnd, menus.HiBackGnd); + colour( le_int(menus.HiForeGnd), le_int(menus.HiBackGnd)); } else { highlight = 0 ; - colour( menus.ForeGnd, menus.BackGnd ); + colour( le_int(menus.ForeGnd), le_int(menus.BackGnd) ); } } else { escaped=0;