From: Theodore Tso Date: Wed, 10 Jul 1996 05:22:50 +0000 (+0000) Subject: win_glue.c: Add a quick hack so we can time-bomb the libkrb5.dll and X-Git-Tag: krb5-1.0-beta7~315 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd4ca683c961f969e4eef59d2479742c5e12eca3;p=krb5.git win_glue.c: Add a quick hack so we can time-bomb the libkrb5.dll and sapkrb5.dll when we compile them at MIT. Makefile.in (sap_glue.obj): Build the sapkrb5.dll with the timebomb enabled (since we couldn't get the version server code working). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8651 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/ChangeLog b/src/lib/ChangeLog index f179eacde..25043838e 100644 --- a/src/lib/ChangeLog +++ b/src/lib/ChangeLog @@ -1,3 +1,12 @@ +Tue Jul 9 16:44:22 1996 Theodore Ts'o + + * win_glue.c: Add a quick hack so we can time-bomb the libkrb5.dll + and sapkrb5.dll when we compile them at MIT. + + * Makefile.in (sap_glue.obj): Build the sapkrb5.dll with the + timebomb enabled (since we couldn't get the version server + code working). + Wed Jun 12 12:52:30 1996 Ezra Peisach * Makefile.in (lib-windows): Replace spaces with tab diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 2d38d1812..f0eaef89f 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -53,9 +53,12 @@ libkrb5.dll:: $(LIBS) libkrb5.def win_glue.obj rc /nologo /p /k libkrb5.dll sap_glue.obj: win_glue.c - $(CC) $(CFLAGS) -DSAP_VERSERV -I$(VERS_DIR) /c \ + $(CC) $(CFLAGS) -DSAP_TIMEBOMB -I$(VERS_DIR) /c \ /Fosap_glue.obj win_glue.c +win_glue.obj: win_glue.c + $(CC) $(CFLAGS) /c win_glue.c + sapkrb5.dll:: $(GLIB) $(LIBS) gssapi.def sap_glue.obj link /co /seg:400 /noe /nod /nol sap_glue, sapkrb5.dll, sapkrb5.map, \ $(LIBS) $(VERS_DIR)\vswin.lib ldllcew libw oldnames, sapkrb5.def diff --git a/src/lib/win_glue.c b/src/lib/win_glue.c index 2da79b40e..d156961c9 100644 --- a/src/lib/win_glue.c +++ b/src/lib/win_glue.c @@ -20,6 +20,30 @@ #define NEED_SOCKETS #include "k5-int.h" +/* + * #defines for MIT-specific time-based timebombs and/or version + * server for the Kerberos DLL. + */ +#ifdef SAP_TIMEBOMB +#if 1 +#define TIMEBOMB 852094800 /* 1-Jan-97 */ +#else +#define TIMEBOMB 820472400 /* 1-Jan-96 */ +#endif +#define TIMEBOMB_PRODUCT "SAPGUI" +#define TIMEBOMB_WARN 31 +#endif + +#ifdef KRB_TIMEBOMB +#if 1 +#define TIMEBOMB 852094800 /* 1-Jan-97 */ +#else +#define TIMEBOMB 820472400 /* 1-Jan-96 */ +#endif +#define TIMEBOMB_PRODUCT "Kerberos V5" +#define TIMEBOMB_WARN 31 +#endif + #ifdef SAP_VERSERV #define VERSERV #define APP_TITLE "KRB5-SAP" @@ -108,11 +132,29 @@ WORD wDataSeg; WORD cbHeap; LPSTR CmdLine; { +#ifdef TIMEBOMB + char buf[256]; + long timeleft; + + timeleft = TIMEBOMB - time(0); + if (timeleft <= 0) { + sprintf(buf, "Your version of %s has expired.\n", TIMEBOMB_PRODUCT); + strcat(buf, "Please upgrade it."); + MessageBox(NULL, buf, "", MB_OK); + PostQuitMessage(0); + } + timeleft = timeleft / ((long) 60*60*24); + if (timeleft < TIMEBOMB_WARN) { + sprintf(buf, "Your version of %s will expire in %ld days.\n", + TIMEBOMB_PRODUCT, timeleft); + strcat(buf, "Please upgrade it soon."); + MessageBox(NULL, buf, "", MB_OK); + } +#endif #ifdef SAP_VERSERV if (CallVersionServer(APP_TITLE, APP_VER, APP_INI, NULL)) PostQuitMessage(0); #endif - win_socket_initialize (); return 1; }