New SAP resource files for doing timebombed GSSAPI libraries for the benefit
authorTheodore Tso <tytso@mit.edu>
Wed, 30 Oct 1996 03:50:04 +0000 (03:50 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 30 Oct 1996 03:50:04 +0000 (03:50 +0000)
of SAP clients.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9251 dc483132-0cff-0310-8789-dd5450dbe970

src/mac/SAP/GSSforSAP.r [new file with mode: 0644]
src/mac/SAP/macSAPglue.c [new file with mode: 0644]

diff --git a/src/mac/SAP/GSSforSAP.r b/src/mac/SAP/GSSforSAP.r
new file mode 100644 (file)
index 0000000..ca25a83
--- /dev/null
@@ -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 (file)
index 0000000..a667285
--- /dev/null
@@ -0,0 +1,50 @@
+#include <CodeFragments.h>
+#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(&currentTime);
+       
+       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;
+}
+