summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1996-12-21 06:47:32 +0000
committerTheodore Tso <tytso@mit.edu>1996-12-21 06:47:32 +0000
commita34aad787c21257a11a54a382fa4d03ff96e6c63 (patch)
tree54c7f47ff15d0a466d5da3d2af790561299e603f /src
parente31ff65597ca946574d74b51c72b266c843f8245 (diff)
downloadkrb5-a34aad787c21257a11a54a382fa4d03ff96e6c63.tar.gz
krb5-a34aad787c21257a11a54a382fa4d03ff96e6c63.tar.xz
krb5-a34aad787c21257a11a54a382fa4d03ff96e6c63.zip
Checked in Macintosh changes from Marshall
GSSforSAP.r: Moved resources for the timebomb out to Rez format for easier CVSing macSAPglue.c (__initializeSAPglue): Added new conditions to the timebomb code so that it can identify individual applications and not just fail globally. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9672 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/mac/SAP/ChangeLog8
-rw-r--r--src/mac/SAP/GSSforSAP.r15
-rw-r--r--src/mac/SAP/macSAPglue.c88
3 files changed, 71 insertions, 40 deletions
diff --git a/src/mac/SAP/ChangeLog b/src/mac/SAP/ChangeLog
index 5d26bb6a1..c1fc92c4f 100644
--- a/src/mac/SAP/ChangeLog
+++ b/src/mac/SAP/ChangeLog
@@ -1,3 +1,11 @@
+Fri Dec 20 12:35:32 1996 Marshall Vale <mjv@mit.edu>
+
+ * GSSforSAP.r: Moved resources for the timebomb out to Rez
+ format for easier CVSing
+ * macSAPglue.c (__initializeSAPglue): Added new conditions to the
+ timebomb code so that it can identify individual applications
+ and not just fail globally.
+
Tue Dec 17 13:53:36 1996 Theodore Y. Ts'o <tytso@mit.edu>
* GSSforSAP.r: Fix expire time in the text resource to be June 1,
diff --git a/src/mac/SAP/GSSforSAP.r b/src/mac/SAP/GSSforSAP.r
index 53fc76c7e..ca25a8384 100644
--- a/src/mac/SAP/GSSforSAP.r
+++ b/src/mac/SAP/GSSforSAP.r
@@ -1,17 +1,4 @@
-#ifdef mw_rez
-#include <SysTypes.r>
-#include <Types.r>
-#else
-#include "SysTypes.r"
#include "Types.r"
-#endif
-
-resource 'vers' (1) {
- 0x01, 0x00, final, 0x00,
- verUS,
- "1.0",
- "1.0(SAP), Copyright 1996 Massachusetts Institute of Technology"
-};
resource 'DITL' (135, nonpurgeable) {
{ /* array DITLarray: 2 elements */
@@ -46,7 +33,7 @@ resource 'DITL' (136, nonpurgeable) {
StaticText {
disabled,
"This version of the SAP client will expi"
- "re on June 1, 1997. Please consult: "
+ "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."
diff --git a/src/mac/SAP/macSAPglue.c b/src/mac/SAP/macSAPglue.c
index 5dc1eef9d..11d3ff720 100644
--- a/src/mac/SAP/macSAPglue.c
+++ b/src/mac/SAP/macSAPglue.c
@@ -1,4 +1,6 @@
#include <CodeFragments.h>
+#include <Processes.h>
+
#define TBALERTID 135
#define TB30ALERTID 136
@@ -6,44 +8,78 @@ OSErr __initializeSAPglue(InitBlockPtr ibp);
OSErr __initializeSAPglue(InitBlockPtr ibp)
{
- OSErr err = noErr;
- short fileRefNum;
- DateTimeRec goalTimeBomb;
- long currentTime, goalTimeBombInSecs;
+ OSErr err = noErr;
+ short fileRefNum, theCurrentRes;
+ DateTimeRec goalTimeBomb;
+ long currentTime, goalTimeBombInSecs;
+ ProcessSerialNumber thePSN;
+ ProcessInfoRec thePIR;
+ /* Do normal init of the shared library */
__initialize();
- if (ibp->fragLocator.where == kDataForkCFragLocator) {
+ /* Start our hack by saving the current resource ref*/
+
+ theCurrentRes = CurResFile();
+
+ if (ibp->fragLocator.where == kDataForkCFragLocator)
+ {
fileRefNum = FSpOpenResFile(ibp->fragLocator.u.onDisk.fileSpec, fsRdPerm);
if ( fileRefNum == -1 )
err = ResError();
}
- goalTimeBomb.year = 1997;
- goalTimeBomb.month = 6;
- goalTimeBomb.day = 1;
- 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);
+ /* We assume that the current process is the one calling us. Good bet */
+ err = GetCurrentProcess( &thePSN );
+
+ if ( err == noErr )
+ {
+ GetProcessInformation( &thePSN, &thePIR );
+
+ if ( thePIR.processType == 'APPL' )
+ {
+ switch ( thePIR.processSignature )
+ {
+ /* Here we case off each application based on its type code */
+ case 'MIDA':
+ /* This is SAP (supposedly) */
+
+ goalTimeBomb.year = 1997;
+ goalTimeBomb.month = 6;
+ goalTimeBomb.day = 1;
+ 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);
+ }
+ break;
+ default:
+ break;
+ }
+ }
}
-
if ( fileRefNum != -1 )
CloseResFile( fileRefNum );
+
+ UseResFile( theCurrentRes );
return err;
}