From a8310b6fd5ff1c05568364472ca5469cabc28831 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 30 Oct 1996 03:50:04 +0000 Subject: [PATCH] New SAP resource files for doing timebombed GSSAPI libraries for the benefit of SAP clients. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9251 dc483132-0cff-0310-8789-dd5450dbe970 --- src/mac/SAP/GSSforSAP.r | 116 +++++++++++++++++++++++++++++++++++++++ src/mac/SAP/macSAPglue.c | 50 +++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 src/mac/SAP/GSSforSAP.r create mode 100644 src/mac/SAP/macSAPglue.c diff --git a/src/mac/SAP/GSSforSAP.r b/src/mac/SAP/GSSforSAP.r new file mode 100644 index 000000000..ca25a8384 --- /dev/null +++ b/src/mac/SAP/GSSforSAP.r @@ -0,0 +1,116 @@ +#include "Types.r" + +resource 'DITL' (135, nonpurgeable) { + { /* array DITLarray: 2 elements */ + /* [1] */ + {96, 292, 116, 360}, + Button { + enabled, + "OK" + }, + /* [2] */ + {16, 64, 84, 360}, + StaticText { + disabled, + "This version of the SAP client has expir" + "ed. Please consult: http://web.mit.edu/r" + "eeng/www/saphelp/ for instructions on ob" + "taining a new version." + } + } +}; + +resource 'DITL' (136, nonpurgeable) { + { /* array DITLarray: 2 elements */ + /* [1] */ + {116, 300, 136, 368}, + Button { + enabled, + "OK" + }, + /* [2] */ + {16, 64, 100, 360}, + StaticText { + disabled, + "This version of the SAP client will expi" + "re on January 15, 1997. Please consult: " + "http://web.mit.edu/reeng/www/saphelp/ fo" + "r instructions on obtaining a new versio" + "n when it is available." + } + } +}; + +data 'DLGX' (135) { + $"0743 6869 6361 676F 0000 0000 0000 0000" /* .Chicago........ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"000C 0000 0000 0001 0004 0004 0000 0000" /* ................ */ + $"0002 0000 0000 0000 0000 0000 0000 0006" /* ................ */ + $"0000 0000 0000 0000 0000" /* .......... */ +}; + +data 'DLGX' (136) { + $"0743 6869 6361 676F 0000 0000 0000 0000" /* .Chicago........ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */ + $"000C 0000 0000 0001 0004 0004 0000 0000" /* ................ */ + $"0002 0000 0000 0000 0000 0000 0000 0006" /* ................ */ + $"0000 0000 0000 0000 0000" /* .......... */ +}; + +data 'ictb' (136) { + $"0000 0000 0000 0000" /* ........ */ +}; + +resource 'ALRT' (135, nonpurgeable) { + {383, 390, 511, 770}, + 135, + { /* array: 4 elements */ + /* [1] */ + OK, visible, sound1, + /* [2] */ + OK, visible, sound1, + /* [3] */ + OK, visible, sound1, + /* [4] */ + OK, visible, sound1 + } + /****** Extra bytes follow... ******/ + /* $"0000" /* .. */ +}; + +resource 'ALRT' (136, nonpurgeable) { + {383, 390, 531, 774}, + 136, + { /* array: 4 elements */ + /* [1] */ + OK, visible, sound1, + /* [2] */ + OK, visible, sound1, + /* [3] */ + OK, visible, sound1, + /* [4] */ + OK, visible, sound1 + } + /****** Extra bytes follow... ******/ + /* $"0000" /* .. */ +}; + +resource 'actb' (136) { + { /* array ColorSpec: 5 elements */ + /* [1] */ + wContentColor, 65535, 65535, 65535, + /* [2] */ + wFrameColor, 0, 0, 0, + /* [3] */ + wTextColor, 0, 0, 0, + /* [4] */ + wHiliteColor, 0, 0, 0, + /* [5] */ + wTitleBarColor, 65535, 65535, 65535 + } +}; + diff --git a/src/mac/SAP/macSAPglue.c b/src/mac/SAP/macSAPglue.c new file mode 100644 index 000000000..a6672852a --- /dev/null +++ b/src/mac/SAP/macSAPglue.c @@ -0,0 +1,50 @@ +#include +#define TBALERTID 135 +#define TB30ALERTID 136 + +OSErr __initializeSAPglue(InitBlockPtr ibp); + +OSErr __initializeSAPglue(InitBlockPtr ibp) +{ + OSErr err = noErr; + short fileRefNum; + DateTimeRec goalTimeBomb; + long currentTime, goalTimeBombInSecs; + + __initialize(); + + if (ibp->fragLocator.where == kDataForkCFragLocator) { + fileRefNum = FSpOpenResFile(ibp->fragLocator.u.onDisk.fileSpec, fsRdPerm); + + if ( fileRefNum == -1 ) + err = ResError(); + } + + goalTimeBomb.year = 1997; + goalTimeBomb.month = 1; + goalTimeBomb.day = 15; + goalTimeBomb.hour = 0; /* Let's use midnight for simplicity */ + goalTimeBomb.minute = 0; + goalTimeBomb.second = 0; + + DateToSeconds( &goalTimeBomb, &goalTimeBombInSecs ); + + GetDateTime(¤tTime); + + if ( (goalTimeBombInSecs - currentTime) <= 0 ) { + StopAlert(TBALERTID, NULL); + /* if we just reported an error, then the SAP client would continue running. We + don't want that so instead we'll just call ExitToShell and hope it doesn't + leave anything hangin. If we just wanted the error, report non-zero */ + //err = -1; + ExitToShell(); + } else if ( (goalTimeBombInSecs - currentTime) < 1209600 ) { /* num seconds in 14 days */ + NoteAlert(TB30ALERTID, NULL); + } + + if ( fileRefNum != -1 ) + CloseResFile( fileRefNum ); + + return err; +} + -- 2.26.2