From: Miro Jurisic Date: Mon, 22 Nov 1999 22:46:55 +0000 (+0000) Subject: Don't need Kerberos5GlobalsLib, use CCAPI v3 instead X-Git-Tag: krb5-1.2-beta1~183 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93a6c21f2f9d86949c24812918fe63b6e44e31bb;p=krb5.git Don't need Kerberos5GlobalsLib, use CCAPI v3 instead git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11906 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.c b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.c deleted file mode 100644 index a7952cfc1..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright 1998 by the Massachusetts Institute of Technology. - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting - * documentation, and that the name of M.I.T. not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" - * without express or implied warranty. - */ - - -/* - * Definitions for globally shared data used by the Kerberos v5 library - * - * $Header$ - */ - -#include -#include -#include -#include - - -#include "Krb5GlobalsData.h" -#include "Krb5Globals.CFM.h" - -apiCB* gCCContext = nil; - -/* $Header$ */ - -/* Include MITAthenaCore for: - - prototypes for __initialize and __terminate - - resource-fork access utilities for shared libraries - */ - -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import on -#endif - - pascal OSErr __initialize (const CFragInitBlock* theInitBlock); - pascal void __terminate (void); - -/* Standard CFM initializion function prototype */ -pascal OSErr -__initialize_Kerberos5GlobalsLib ( - CFragInitBlockPtr inInitBlock); - -/* Standard CFM termination function prototype */ -pascal void -__terminate_Kerberos5GlobalsLib ( - void); - -/* CFM magic again */ -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import reset -#endif - -/* This is the initialization function. - This function is guaranteed to be called every time the library is prepared -- which - is whenever an application is launched that uses the library - In order for this to happen, the function name must be entered in the "Initialization function" - field in PPC and CFM-68K linker preferences. - - If this function returns an error code, preparation of the library fails. When preparation fails, - either the Finder displays an error message (in the case of strong linking) or library is not loaded - (in the case of weak linking). -*/ -pascal OSErr -__initialize_Kerberos5GlobalsLib ( - CFragInitBlockPtr inInitBlock) -{ - OSErr err = noErr; - cc_uint32 ccErr; - - /* Always do this first in your own initialization function -- this calls runtime - library to initialize your globals and your exceptions table */ - err = __initialize (inInitBlock); - if (err != noErr) - return err; - - ccErr = cc_initialize (&gCCContext, CC_API_VER_2, NULL, NULL); - if (ccErr != CC_NOERROR) - return memFullErr; - - gKerberos5GlobalsRefCount++; - if (gKerberos5SystemDefaultCacheName == nil) - err = Krb5GlobalsSetUniqueDefaultCacheName (); - - return err; -} - -/* This is the shared library termination function. - Here you need to undo, in the reverse order, everything you did in - the initialization function. - - This function can't fail. -*/ - -pascal void -__terminate_Kerberos5GlobalsLib ( - void) -{ - /* First, clean up your library-specific structures. - ErrorLib does nothing here, since it doesn't take ownership - of error tables */ - - cc_shutdown (&gCCContext); - - gKerberos5GlobalsRefCount--; - - /* Dispose ccache name if we are last instance */ - if ((gKerberos5GlobalsRefCount == 0) && (gKerberos5SystemDefaultCacheName != nil)) { - DisposePtr (gKerberos5SystemDefaultCacheName); - gKerberos5SystemDefaultCacheName = nil; - } - - /* Finally, cleanup exception tables and global chain */ - __terminate (); -} \ No newline at end of file diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.h b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.h deleted file mode 100644 index dde7b3f14..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.CFM.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Global CCache context for Kerberos v5 globals library - */ - -#ifndef __Krb5Globlas_CFM_h__ -#define __Krb5Globlas_CFM_h__ - -extern apiCB* gCCContext; - -#endif /* __Krb5Globlas_CFM_h__ */ \ No newline at end of file diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.c b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.c deleted file mode 100644 index 60f7ce9eb..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.c +++ /dev/null @@ -1,116 +0,0 @@ -/* Copyright 1998 by the Massachusetts Institute of Technology. - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting - * documentation, and that the name of M.I.T. not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" - * without express or implied warranty. - */ - - -/* - * Definitions for globally shared data used by the Kerberos v5 library - * - * $Header$ - */ - -#include - -#include - -#include -#include - -#include "Krb5Globals.h" -#include "Krb5GlobalsData.h" -#include "Krb5Globals.CFM.h" - -/* - * Set the default cache name - */ - -OSStatus -Krb5GlobalsSetDefaultCacheName ( - char* inName) -{ - char* newName; - - newName = NewPtrSys (strlen (inName) + 1); - - if (newName == nil) - return MemError(); - - BlockMoveData (inName, newName, strlen (inName) + 1); - if (gKerberos5SystemDefaultCacheName != nil) - DisposePtr (gKerberos5SystemDefaultCacheName); - gKerberos5SystemDefaultCacheName = newName; - gKerberos5SystemDefaultCacheNameModification++; - return noErr; -} - -/* - * Get the default cache name - */ - -UInt32 -Krb5GlobalsGetDefaultCacheName ( - char* inName, - UInt32 inLength) -{ - if (inName != nil) { - BlockMoveData (gKerberos5SystemDefaultCacheName, inName, inLength); - inName [inLength] = '\0'; - } - return strlen (gKerberos5SystemDefaultCacheName) + 1; -} - -/* - * Set the default cache name to something unique - * (i.e. not a name of an existing ccache) - */ - -OSStatus -Krb5GlobalsSetUniqueDefaultCacheName () -{ - OSStatus err = noErr; - UInt32 i; - char name [16]; - cc_uint32 ccErr; - ccache_p* ccache; - - /* Infinite loop! I presume you won't have 2^32 ccaches... */ - for (i = 0; ;i++) { - sprintf (name, "%d", i); - ccErr = cc_open (gCCContext, name, CC_CRED_V5, 0L, &ccache); - if (ccErr == CC_NO_EXIST) { - err = Krb5GlobalsSetDefaultCacheName (name); - break; - } else if (ccErr == CC_NOERROR) { - cc_close (gCCContext, &ccache); - } else { - err = memFullErr; - break; - } - } - - return err; -} - -/* - * Return the modification number - */ - -UInt32 -Krb5GlobalsGetDefaultCacheNameModification () -{ - return gKerberos5SystemDefaultCacheNameModification; -} \ No newline at end of file diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.exp b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.exp deleted file mode 100644 index c054c5c02..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.exp +++ /dev/null @@ -1,10 +0,0 @@ -# -# Exports for accessors for globally shared data used by Kerberos v5 library -# -# $Header$ -# - -Krb5GlobalsSetDefaultCacheName -Krb5GlobalsGetDefaultCacheName -Krb5GlobalsSetUniqueDefaultCacheName -Krb5GlobalsGetDefaultCacheNameModification diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.h b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.h deleted file mode 100644 index 4696e20ae..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Decalrations for Kerberos v5 systemwide globals - * - * $Header$ - */ - -#ifndef __Krb5Globals_h__ -#define __Krb5Globals_h__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import on -#endif - -/* - * Set the default cache name - * - * inName is a C string with the name of the new cache - * - * returns: noErr, memFullErr - */ - -OSStatus -Krb5GlobalsSetDefaultCacheName ( - char* inName); - -/* - * Retrieve the default cache name - * - * inName should point to at least inLength bytes of storage - * if inName is nil, just returns the length - * - * returns: length of default cache name - */ - -UInt32 -Krb5GlobalsGetDefaultCacheName ( - char* inName, - UInt32 inLength); - -/* - * Set the default cache name to a unique string - * - * Sets the default cache name to a string that is not the name - * of an existing cache - */ - -OSStatus -Krb5GlobalsSetUniqueDefaultCacheName (); - -/* - * Get modification number - * - * Modification number changes whenever default cache name changes - */ - -UInt32 -Krb5GlobalsGetDefaultCacheNameModification (); - -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import reset -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __Krb5Globals_h__ */ \ No newline at end of file diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.html b/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.html deleted file mode 100644 index 7ed835336..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5Globals.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Kerberos v5 Globals Library API Functions - - -
- - - - - -
MIT Information Systems

Macintosh Development


- [Home] - [About Us] - [People] - [Applications] - [MIT Support Library]
- [MIT Kerberos] - [Mac OS X] - [Developer Documentation] - [Information Systems] -


- - - - - - -
Kerberos v5 Globals Library API Functions
-
- OSStatus Krb5GlobalsSetDefaultCacheName - (char* inName);
-
- Krb5GlobalsSetDefaultCacheName sets the systemwide default cache for the Kerberos 5 - library to inName. -

- If successful, the function returns noErr. If it fails to allocate - memory for the cache name, it returns memFullErr. -

- UInt32 Krb5GlobalsGetDefaultCacheName - (char* inName, UInt32 inLength); - -
- Krb5GlobalsGetDefaultCacheName returns the name of the current systemwide default - credentials cache for the Kerberos v5 library. inName should point - to at least inLength bytes of memory. Actual length of the cache - name is returned.

- If inName is nil, the length of the cache name is - returned. -

- OSStatus Krb5GlobalsSetUniqueDefaultCacheName - ();
-
- Krb5GlobalsSetUniqueDefaultCacheName sets the systemwide default credentials cache - name for Kerberos v5 library to a unique string (i.e., one that is not the name - of any of the existing credentials caches). -

- If successful, the function returns noErr. If it fails to allocate - memory for the cache name, it returns memFullErr. -

- UInt32 Krb5GlobalsGetDefaultCacheNameModification - ();
-
- Krb5GlobalsGetDefaultCacheNameModification returns modification counter for the - systemwide default credentials cache name for the Kerberos v5 library. If result - of two calls to Krb5GlobalsGetDefaultCacheNameModification is different, the - default cache name has changed between them. -
-
- -


Questions or comments? Send mail to -macdev@mit.edu
-Last updated on $Date$
-Last modified by $Author$ - - diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.c b/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.c deleted file mode 100644 index 09b082259..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Definitions for globally shared data used by the Kerberos v5 library - * - * $Header$ - */ - -#include "Krb5GlobalsData.h" - -UInt32 gKerberos5GlobalsRefCount = 0; -UInt32 gKerberos5SystemDefaultCacheNameModification = 0; -char* gKerberos5SystemDefaultCacheName = nil; - diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.exp b/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.exp deleted file mode 100644 index 10bc009b2..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.exp +++ /dev/null @@ -1,9 +0,0 @@ -# -# Exports for globally shared data used by Kerberos v5 library -# -# $Header$ -# - -gKerberos5GlobalsRefCount -gKerberos5SystemDefaultCacheName -gKerberos5SystemDefaultCacheNameModification diff --git a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.h b/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.h deleted file mode 100644 index 41f7106db..000000000 --- a/src/mac/libraries/Kerberos v5 Globals/Krb5GlobalsData.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Declarations for globally shared data used by Kerberos v5 library - * - * $Header$ - */ - -#ifndef __Krb5GlobalsData_h__ -#define __Krb5GlobalsData_h__ - -#include - -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import on -#endif - -extern UInt32 gKerberos5GlobalsRefCount; -extern char* gKerberos5SystemDefaultCacheName; -extern UInt32 gKerberos5SystemDefaultCacheNameModification; - -#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__) -# pragma import reset -#endif - -#endif /* __Krb5GlobalsData_h__ */ \ No newline at end of file