+++ /dev/null
-/* 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 <Types.h>
-#include <Errors.h>
-#include <CCache2.h>
-#include <CodeFragments.h>
-
-
-#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
+++ /dev/null
-/*
- * 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
+++ /dev/null
-/* 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 <Errors.h>
-
-#include <CCache2.h>
-
-#include <string.h>
-#include <stdio.h>
-
-#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
+++ /dev/null
-#
-# Exports for accessors for globally shared data used by Kerberos v5 library
-#
-# $Header$
-#
-
-Krb5GlobalsSetDefaultCacheName
-Krb5GlobalsGetDefaultCacheName
-Krb5GlobalsSetUniqueDefaultCacheName
-Krb5GlobalsGetDefaultCacheNameModification
+++ /dev/null
-/*
- * 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
+++ /dev/null
-<!-- #include "header.html"
- #TITLE#="Kerberos v5 Globals Library API Functions"
- #BASEHREF#=""
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
- <TITLE> Kerberos v5 Globals Library API Functions </TITLE>
-</HEAD>
-<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#663399">
-<CENTER>
- <TABLE BORDER=0 CELLSPACING=8>
- <TR>
- <TD><IMG SRC="http://web.mit.edu/macdev/www/is-logo.gif" ALT="MIT Information Systems"></TD>
- <TD><BR><H1>Macintosh Development</H1></TD>
- </TR>
- </TABLE> <BR>
- [<A HREF="http://web.mit.edu/macdev/www/macdev.html">Home</A>]
- [<A HREF="http://web.mit.edu/macdev/www/about.html">About Us</A>]
- [<A HREF="http://web.mit.edu/macdev/www/people.html">People</A>]
- [<A HREF="http://web.mit.edu/macdev/www/applications.html">Applications</A>]
- [<A HREF="http://web.mit.edu/macdev/www/support.html">MIT Support Library</A>] <BR>
- [<A HREF="http://web.mit.edu/macdev/www/kerberos.html">MIT Kerberos</A>]
- [<A HREF="http://web.mit.edu/macdev/www/macosx.html">Mac OS X</A>]
- [<A HREF="http://web.mit.edu/macdev/www/documentation.html">Developer Documentation</A>]
- [<A HREF="http://web.mit.edu/is/">Information Systems</A>]
-<P> </CENTER> <HR>
-<!-- end include -->
-<TABLE BORDER=0 CELLSPACING=4>
- <TR>
- <TD><IMG SRC="../../Common/Documentation/graphics/MITKerberosLib.gif"></TD>
- <TD><B><FONT SIZE="+3">Kerberos v5 Globals Library API Functions</FONT></B></TD>
- </TR>
-</TABLE>
-<BLOCKQUOTE>
- <FONT SIZE="+1"><CODE>OSStatus <A NAME="Krb5GlobalsSetDefaultCacheName"><B>Krb5GlobalsSetDefaultCacheName</B></A>
- (char* inName);</CODE></FONT><BR>
- <BLOCKQUOTE>
- Krb5GlobalsSetDefaultCacheName sets the systemwide default cache for the Kerberos 5
- library to <CODE>inName</CODE>.
- <P>
- If successful, the function returns <CODE>noErr</CODE>. If it fails to allocate
- memory for the cache name, it returns <CODE>memFullErr</CODE>.
- </BLOCKQUOTE>
- <FONT SIZE="+1"><CODE>UInt32 <A HREF = "Krb5GlobalsGetDefaultCacheName"><B>Krb5GlobalsGetDefaultCacheName</B></A>
- (char* inName, UInt32 inLength);
-</CODE></FONT>
- <BLOCKQUOTE>
- Krb5GlobalsGetDefaultCacheName returns the name of the current systemwide default
- credentials cache for the Kerberos v5 library. <CODE>inName</CODE> should point
- to at least <CODE>inLength</CODE> bytes of memory. Actual length of the cache
- name is returned. <P>
- If <CODE>inName</CODE> is <CODE>nil</CODE>, the length of the cache name is
- returned.
- </BLOCKQUOTE>
- <FONT SIZE="+1"><CODE>OSStatus <A NAME="Krb5GlobalsSetUniqueDefaultCacheName"><B>Krb5GlobalsSetUniqueDefaultCacheName</B></A>
- ();</CODE></FONT><BR>
- <BLOCKQUOTE>
- 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).
- <P>
- If successful, the function returns <CODE>noErr</CODE>. If it fails to allocate
- memory for the cache name, it returns <CODE>memFullErr</CODE>.
- </BLOCKQUOTE>
- <FONT SIZE="+1"><CODE>UInt32 <A NAME="Krb5GlobalsGetDefaultCacheNameModification"><B>Krb5GlobalsGetDefaultCacheNameModification</B></A>
- ();</CODE></FONT><BR>
- <BLOCKQUOTE>
- 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.
- </BLOCKQUOTE>
-</BLOCKQUOTE>
-<!-- #include "footer.html" -->
-<P> <HR> <FONT SIZE="+1"> <B> Questions or comments? Send mail to
-<A HREF="mailto:macdev@mit.edu">macdev@mit.edu</A> </B> </FONT> <BR>
-Last updated on $Date$ <BR>
-Last modified by $Author$
-</BODY> </HTML>
-<!-- end include -->
+++ /dev/null
-/*
- * Definitions for globally shared data used by the Kerberos v5 library
- *
- * $Header$
- */
-
-#include "Krb5GlobalsData.h"
-
-UInt32 gKerberos5GlobalsRefCount = 0;
-UInt32 gKerberos5SystemDefaultCacheNameModification = 0;
-char* gKerberos5SystemDefaultCacheName = nil;
-
+++ /dev/null
-#
-# Exports for globally shared data used by Kerberos v5 library
-#
-# $Header$
-#
-
-gKerberos5GlobalsRefCount
-gKerberos5SystemDefaultCacheName
-gKerberos5SystemDefaultCacheNameModification
+++ /dev/null
-/*
- * Declarations for globally shared data used by Kerberos v5 library
- *
- * $Header$
- */
-
-#ifndef __Krb5GlobalsData_h__
-#define __Krb5GlobalsData_h__
-
-#include <Types.h>
-
-#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