diff -c -r -N src.old/aclocal.m4 src/aclocal.m4 *** src.old/aclocal.m4 Tue Aug 5 17:02:25 2003 --- src/aclocal.m4 Tue Aug 5 17:02:17 2003 *************** *** 1171,1177 **** AC_SUBST(krb5_cv_host) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([V5_SET_TOPDIR])dnl ! . $ac_topdir/config/shlib.conf]) dnl dnl The following was written by jhawk@mit.edu dnl --- 1171,1181 ---- AC_SUBST(krb5_cv_host) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([V5_SET_TOPDIR])dnl ! . $ac_topdir/config/shlib.conf ! if test "x$use_ccapi" = xyes; then ! AC_DEFINE(USE_CCAPI,1,[Define for CCAPI support in OS X]) ! fi ! ]) dnl dnl The following was written by jhawk@mit.edu dnl diff -c -r -N src.old/config/shlib.conf src/config/shlib.conf *** src.old/config/shlib.conf Tue Aug 5 17:02:18 2003 --- src/config/shlib.conf Tue Aug 5 17:02:09 2003 *************** *** 212,221 **** SHLIBSEXT='.$(LIBMAJOR).dylib' SHLIB_EXPFLAGS='$(SHLIB_DIRS) $(SHLIB_EXPLIBS)' SHLIBEXT=.dylib ! LDCOMBINE='$(CC) -undefined warning -dynamiclib -compatibility_version $(LIBMAJOR) -current_version $(LIBMAJOR).$(LIBMINOR) -install_name "$(KRB5_LIBDIR)/lib$(LIB)$(SHLIBVEXT)" $(CFLAGS) $(LDFLAGS)' CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -dynamic $(CFLAGS) $(LDFLAGS)' CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)' RUN_ENV='DYLD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export DYLD_LIBRARY_PATH;' ;; *-*-solaris*) --- 212,222 ---- SHLIBSEXT='.$(LIBMAJOR).dylib' SHLIB_EXPFLAGS='$(SHLIB_DIRS) $(SHLIB_EXPLIBS)' SHLIBEXT=.dylib ! LDCOMBINE='$(CC) -bind_at_load -dynamiclib -compatibility_version $(LIBMAJOR) -current_version $(LIBMAJOR).$(LIBMINOR) -install_name "$(KRB5_LIBDIR)/lib$(LIB)$(SHLIBVEXT)" $(CFLAGS) $(LDFLAGS)' CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -dynamic $(CFLAGS) $(LDFLAGS)' CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)' RUN_ENV='DYLD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export DYLD_LIBRARY_PATH;' + use_ccapi=yes ;; *-*-solaris*) diff -c -r -N src.old/lib/krb4/password_to_key.c src/lib/krb4/password_to_key.c *** src.old/lib/krb4/password_to_key.c Tue Aug 5 17:02:19 2003 --- src/lib/krb4/password_to_key.c Tue Aug 5 17:02:10 2003 *************** *** 30,36 **** --- 30,40 ---- #include #ifdef USE_CCAPI + #if defined(__MACH__) && defined(__APPLE__) + #include + #else #include + #endif #endif #include "krb.h" #include "krb4int.h" diff -c -r -N src.old/lib/krb5/Makefile.in src/lib/krb5/Makefile.in *** src.old/lib/krb5/Makefile.in Tue Aug 5 17:02:24 2003 --- src/lib/krb5/Makefile.in Tue Aug 5 17:02:16 2003 *************** *** 4,9 **** --- 4,11 ---- BUILDTOP=$(REL)..$(S).. LOCAL_SUBDIRS= error_tables asn.1 ccache keytab krb os rcache posix + LOCALINCLUDES = -I$(srcdir)$(S)ccache$(S)ccapi $(WIN_INCLUDES) + ##DOSBUILDTOP = ..\.. ##DOSLIBNAME=$(OUTPRE)krb5.lib ##DOSOBJFILEDEP=$(OUTPRE)asn1.lst $(OUTPRE)ccache.lst $(OUTPRE)err_tbls.lst $(OUTPRE)keytab.lst $(OUTPRE)krb.lst $(OUTPRE)os.lst $(OUTPRE)posix.lst $(OUTPRE)rcache.lst *************** *** 24,29 **** --- 26,32 ---- error_tables/OBJS.ST \ asn.1/OBJS.ST \ ccache/OBJS.ST \ + ccache/ccapi/OBJS.ST \ keytab/OBJS.ST \ krb/OBJS.ST \ rcache/OBJS.ST \ *************** *** 35,40 **** --- 38,44 ---- error_tables/OBJS.ST \ asn.1/OBJS.ST \ ccache/OBJS.ST \ + ccache/ccapi/OBJS.ST \ keytab/OBJS.ST \ krb/OBJS.ST \ rcache/OBJS.ST \ diff -c -r -N src.old/lib/krb5/ccache/Makefile.in src/lib/krb5/ccache/Makefile.in *** src.old/lib/krb5/ccache/Makefile.in Tue Aug 5 17:02:21 2003 --- src/lib/krb5/ccache/Makefile.in Tue Aug 5 17:02:13 2003 *************** *** 2,8 **** myfulldir=lib/krb5/ccache mydir=ccache BUILDTOP=$(REL)..$(S)..$(S).. ! LOCAL_SUBDIRS = RUN_SETUP = @KRB5_RUN_ENV@ PROG_LIBPATH=-L$(TOPLIBD) --- 2,8 ---- myfulldir=lib/krb5/ccache mydir=ccache BUILDTOP=$(REL)..$(S)..$(S).. ! LOCAL_SUBDIRS=ccapi RUN_SETUP = @KRB5_RUN_ENV@ PROG_LIBPATH=-L$(TOPLIBD) diff -c -r -N src.old/lib/krb5/ccache/ccapi/CredCache.c src/lib/krb5/ccache/ccapi/CredCache.c *** src.old/lib/krb5/ccache/ccapi/CredCache.c Wed Dec 31 18:00:00 1969 --- src/lib/krb5/ccache/ccapi/CredCache.c Tue Aug 5 17:02:12 2003 *************** *** 0 **** --- 1,711 ---- + #if defined(USE_CCAPI) && defined(__MACH__) && defined(__APPLE__) + + #include "CredCache.h" + + #ifdef LOAD_ON_LOAD + #pragma CALL_ON_LOAD load + void load(void) + { + LoadKerberos(); + } + #endif + + static const struct mach_header *LoadKerberos() + { + static int tryload = TRUE; + static const struct mach_header *image = NULL; + + if (!image && tryload) { + image = NSAddImage(KERBEROS_PATH, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + if (!image) + tryload = FALSE; + } + + return image; + } + + cc_int32 cc_initialize ( + cc_context_t* outContext, + cc_int32 inVersion, + cc_int32* outSupportedVersion, + char const** outVendor) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_initialize_ptr) ( + cc_context_t* outContext, + cc_int32 inVersion, + cc_int32* outSupportedVersion, + char const** outVendor); + + static cc_initialize_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_initialize_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_initialize", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(outContext, inVersion, outSupportedVersion, outVendor) : CC_NOT_SUPP; + } + + cc_int32 cc_shutdown ( + apiCB** ioContext) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_shutdown_ptr) ( + apiCB** ioContext); + + static cc_shutdown_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_shutdown_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_shutdown", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(ioContext) : CC_NOT_SUPP; + } + + cc_int32 cc_get_NC_info ( + apiCB* inContext, + infoNC*** outInfo) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_get_NC_info_ptr) ( + apiCB* inContext, + infoNC*** outInfo); + + static cc_get_NC_info_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_get_NC_info_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_get_NC_info", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, outInfo) : CC_NOT_SUPP; + } + + cc_int32 cc_get_change_time ( + apiCB* inContext, + cc_time_t* outTime) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_get_change_time_ptr) ( + apiCB* inContext, + cc_time_t* outTime); + + static cc_get_change_time_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_get_change_time_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_get_change_time", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, outTime) : CC_NOT_SUPP; + } + + cc_int32 cc_open ( + apiCB* inContext, + const char* inName, + cc_int32 inVersion, + cc_uint32 inFlags, + ccache_p** outCCache) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_open_ptr) ( + apiCB* inContext, + const char* inName, + cc_int32 inVersion, + cc_uint32 inFlags, + ccache_p** outCCache); + + static cc_open_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_open_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_open", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inName, inVersion, inFlags, outCCache) : CC_NOT_SUPP; + } + + cc_int32 cc_create ( + apiCB* inContext, + const char* inName, + const char* inPrincipal, + cc_int32 inVersion, + cc_uint32 inFlags, + ccache_p** outCCache) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_create_ptr) ( + apiCB* inContext, + const char* inName, + const char* inPrincipal, + cc_int32 inVersion, + cc_uint32 inFlags, + ccache_p** outCCache); + + static cc_create_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_create_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_create", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inName, inPrincipal, inVersion, inFlags, outCCache) : CC_NOT_SUPP; + } + + cc_int32 cc_close ( + apiCB* inContext, + ccache_p** ioCCache) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_close_ptr) ( + apiCB* inContext, + ccache_p** ioCCache); + + static cc_close_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_close_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_close", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioCCache) : CC_NOT_SUPP; + } + + cc_int32 cc_destroy ( + apiCB* inContext, + ccache_p** ioCCache) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_destroy_ptr) ( + apiCB* inContext, + ccache_p** ioCCache); + + static cc_destroy_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_destroy_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_destroy", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioCCache) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_NCs_begin ( + apiCB* inContext, + ccache_cit** outIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_NCs_begin_ptr) ( + apiCB* inContext, + ccache_cit** outIterator); + + static cc_seq_fetch_NCs_begin_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_NCs_begin_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_NCs_begin", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, outIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_NCs_next ( + apiCB* inContext, + ccache_p** outCCache, + ccache_cit* inIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_NCs_next_ptr) ( + apiCB* inContext, + ccache_p** outCCache, + ccache_cit* inIterator); + + static cc_seq_fetch_NCs_next_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_NCs_next_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_NCs_next", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, outCCache, inIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_NCs_end ( + apiCB* inContext, + ccache_cit** ioIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_NCs_end_ptr) ( + apiCB* inContext, + ccache_cit** ioIterator); + + static cc_seq_fetch_NCs_end_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_NCs_end_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_NCs_end", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_get_name ( + apiCB* inContext, + ccache_p* inCCache, + char** outName) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_get_name_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + char** outName); + + static cc_get_name_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_get_name_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_get_name", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, outName) : CC_NOT_SUPP; + } + + cc_int32 cc_get_cred_version ( + apiCB* inContext, + ccache_p* inCCache, + cc_int32* outVersion) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_get_cred_version_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + cc_int32* outVersion); + + static cc_get_cred_version_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_get_cred_version_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_get_cred_version", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, outVersion) : CC_NOT_SUPP; + } + + cc_int32 cc_set_principal ( + apiCB* inContext, + ccache_p* inCCache, + cc_int32 inVersion, + char* inPrincipal) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_set_principal_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + cc_int32 inVersion, + char* inPrincipal); + + static cc_set_principal_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_set_principal_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_set_principal", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, inVersion, inPrincipal) : CC_NOT_SUPP; + } + + cc_int32 cc_get_principal ( + apiCB* inContext, + ccache_p* inCCache, + char** outPrincipal) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_get_principal_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + char** outPrincipal); + + static cc_get_principal_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_get_principal_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_get_principal", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, outPrincipal) : CC_NOT_SUPP; + } + + cc_int32 cc_store ( + apiCB* inContext, + ccache_p* inCCache, + cred_union inCredentials) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_store_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + cred_union inCredentials); + + static cc_store_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_store_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_store", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, inCredentials) : CC_NOT_SUPP; + } + + cc_int32 cc_remove_cred ( + apiCB* inContext, + ccache_p* inCCache, + cred_union inCredentials) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_remove_cred_ptr) ( + apiCB* inContext, + ccache_p* inCCache, + cred_union inCredentials); + + static cc_remove_cred_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_remove_cred_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_remove_cred", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, inCredentials) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_creds_begin ( + apiCB* inContext, + const ccache_p* inCCache, + ccache_cit** outIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_creds_begin_ptr) ( + apiCB* inContext, + const ccache_p* inCCache, + ccache_cit** outIterator); + + static cc_seq_fetch_creds_begin_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_creds_begin_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_creds_begin", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, inCCache, outIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_creds_next ( + apiCB* inContext, + cred_union** outCreds, + ccache_cit* inIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_creds_next_ptr) ( + apiCB* inContext, + cred_union** outCreds, + ccache_cit* inIterator); + + static cc_seq_fetch_creds_next_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_creds_next_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_creds_next", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, outCreds, inIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_seq_fetch_creds_end ( + apiCB* inContext, + ccache_cit** ioIterator) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_seq_fetch_creds_end_ptr) ( + apiCB* inContext, + ccache_cit** ioIterator); + + static cc_seq_fetch_creds_end_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_seq_fetch_creds_end_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_seq_fetch_creds_end", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioIterator) : CC_NOT_SUPP; + } + + cc_int32 cc_free_principal ( + apiCB* inContext, + char** ioPrincipal) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_free_principal_ptr) ( + apiCB* inContext, + char** ioPrincipal); + + static cc_free_principal_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_free_principal_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_free_principal", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioPrincipal) : CC_NOT_SUPP; + } + + cc_int32 cc_free_name ( + apiCB* inContext, + char** ioName) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_free_name_ptr) ( + apiCB* inContext, + char** ioName); + + static cc_free_name_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_free_name_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_free_name", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioName) : CC_NOT_SUPP; + } + + cc_int32 cc_free_creds ( + apiCB* inContext, + cred_union** creds) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_free_creds_ptr) ( + apiCB* inContext, + cred_union** creds); + + static cc_free_creds_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_free_creds_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_free_creds", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, creds) : CC_NOT_SUPP; + } + + cc_int32 cc_free_NC_info ( + apiCB* inContext, + infoNC*** ioInfo) + { + const struct mach_header *kerb_image; + static int tryload = TRUE; + + typedef cc_int32 (*cc_free_NC_info_ptr) ( + apiCB* inContext, + infoNC*** ioInfo); + + static cc_free_NC_info_ptr dyfunc = NULL; + + kerb_image = LoadKerberos(); + if (!kerb_image) + tryload = FALSE; + else if (!dyfunc && tryload) { + dyfunc = (cc_free_NC_info_ptr) NSAddressOfSymbol( + NSLookupSymbolInImage(kerb_image, "_cc_free_NC_info", + NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)); + if (!dyfunc) + tryload = FALSE; + } + + return dyfunc ? dyfunc(inContext, ioInfo) : CC_NOT_SUPP; + } + + #endif // #if defined(USE_CCAPI) && defined(__MACH__) && defined(__APPLE__) diff -c -r -N src.old/lib/krb5/ccache/ccapi/CredCache.h src/lib/krb5/ccache/ccapi/CredCache.h *** src.old/lib/krb5/ccache/ccapi/CredCache.h Wed Dec 31 18:00:00 1969 --- src/lib/krb5/ccache/ccapi/CredCache.h Tue Aug 5 17:02:12 2003 *************** *** 0 **** --- 1,20 ---- + #ifndef CREDCACHE_H + #define CREDCACHE_H + + #if defined(USE_CCAPI) && defined(__MACH__) && defined(__APPLE__) + + #include + #include + #include + #include + #include + #include + + #include + #include + + #define KERBEROS_PATH "/System/Library/Frameworks/Kerberos.framework/Kerberos" + + #endif // #if defined(USE_CCAPI) && defined(__MACH__) && defined(__APPLE__) + + #endif // #ifndef CREDCACHE_H diff -c -r -N src.old/lib/krb5/ccache/ccapi/Makefile.in src/lib/krb5/ccache/ccapi/Makefile.in *** src.old/lib/krb5/ccache/ccapi/Makefile.in Tue Aug 5 17:02:20 2003 --- src/lib/krb5/ccache/ccapi/Makefile.in Tue Aug 5 17:02:12 2003 *************** *** 14,26 **** STLIBOBJS = \ stdcc.o \ stdcc_util.o \ ! winccld.o ! OBJS = $(OUTPRE)stdcc.$(OBJEXT) $(OUTPRE)stdcc_util.$(OBJEXT) $(OUTPRE)winccld.$(OBJEXT) ! SRCS = $(srcdir)/stdcc.c $(srcdir)/stdcc_util.c $(srcdir)/winccld.c ##DOS##LIBOBJS = $(OBJS) all-unix:: all-libobjs clean-unix:: clean-libobjs --- 14,30 ---- STLIBOBJS = \ stdcc.o \ stdcc_util.o \ ! winccld.o \ ! CredCache.o ! OBJS = $(OUTPRE)stdcc.$(OBJEXT) $(OUTPRE)stdcc_util.$(OBJEXT) $(OUTPRE)winccld.$(OBJEXT) $(OUTPRE)CredCache.$(OBJEXT) ! SRCS = $(srcdir)/stdcc.c $(srcdir)/stdcc_util.c $(srcdir)/winccld.c $(srcdir)/CredCache.c ##DOS##LIBOBJS = $(OBJS) all-unix:: all-libobjs clean-unix:: clean-libobjs + + # @libobj_frag@ + diff -c -r -N src.old/lib/krb5/ccache/ccapi/stdcc.c src/lib/krb5/ccache/ccapi/stdcc.c *** src.old/lib/krb5/ccache/ccapi/stdcc.c Tue Aug 5 17:02:20 2003 --- src/lib/krb5/ccache/ccapi/stdcc.c Tue Aug 5 17:02:12 2003 *************** *** 28,33 **** --- 28,35 ---- * */ + #ifdef USE_CCAPI + #define NEED_WINDOWS #include "stdcc.h" #include "stdcc_util.h" *************** *** 752,754 **** --- 754,759 ---- return 0; } + + #endif /* #ifdef USE_CCAPI */ + diff -c -r -N src.old/lib/krb5/ccache/ccapi/stdcc.h src/lib/krb5/ccache/ccapi/stdcc.h *** src.old/lib/krb5/ccache/ccapi/stdcc.h Tue Aug 5 17:02:20 2003 --- src/lib/krb5/ccache/ccapi/stdcc.h Tue Aug 5 17:02:12 2003 *************** *** 2,8 **** --- 2,12 ---- #include "k5-int.h" #ifdef USE_CCAPI + #if defined(__MACH__) && defined(__APPLE__) + #include + #else #include + #endif #endif #if defined(_WIN32) diff -c -r -N src.old/lib/krb5/ccache/ccapi/stdcc_util.c src/lib/krb5/ccache/ccapi/stdcc_util.c *** src.old/lib/krb5/ccache/ccapi/stdcc_util.c Tue Aug 5 17:02:21 2003 --- src/lib/krb5/ccache/ccapi/stdcc_util.c Tue Aug 5 17:02:13 2003 *************** *** 5,10 **** --- 5,12 ---- * Frank Dabek, July 1998 */ + #ifdef USE_CCAPI + #include #include #include *************** *** 576,578 **** --- 578,583 ---- return CC_NOERROR; } + + #endif /* #ifdef USE_CCAPI */ + diff -c -r -N src.old/lib/krb5/ccache/ccapi/stdcc_util.h src/lib/krb5/ccache/ccapi/stdcc_util.h *** src.old/lib/krb5/ccache/ccapi/stdcc_util.h Tue Aug 5 17:02:21 2003 --- src/lib/krb5/ccache/ccapi/stdcc_util.h Tue Aug 5 17:02:13 2003 *************** *** 4,10 **** --- 4,14 ---- */ #if USE_CCAPI + #if defined(__MACH__) && defined(__APPLE__) + #include + #else #include + #endif #endif #if defined(_WIN32) diff -c -r -N src.old/lib/krb5/configure.in src/lib/krb5/configure.in *** src.old/lib/krb5/configure.in Tue Aug 5 17:02:24 2003 --- src/lib/krb5/configure.in Tue Aug 5 17:02:15 2003 *************** *** 24,27 **** KRB5_BUILD_PROGRAM KRB5_RUN_FLAGS dnl ! V5_AC_OUTPUT_MAKEFILE(. error_tables asn.1 ccache keytab krb rcache os posix) --- 24,27 ---- KRB5_BUILD_PROGRAM KRB5_RUN_FLAGS dnl ! V5_AC_OUTPUT_MAKEFILE(. error_tables asn.1 ccache ccache/ccapi keytab krb rcache os posix) diff -c -r -N src.old/lib/krb5/krb/conv_creds.c src/lib/krb5/krb/conv_creds.c *** src.old/lib/krb5/krb/conv_creds.c Tue Aug 5 17:02:22 2003 --- src/lib/krb5/krb/conv_creds.c Tue Aug 5 17:02:14 2003 *************** *** 31,37 **** --- 31,41 ---- #include "kerberosIV/krb.h" #ifdef USE_CCAPI + #if defined(__MACH__) && defined(__APPLE__) + #include + #else #include + #endif #endif #define krb524_debug krb5int_krb524_debug diff -c -r -N src.old/lib/krb5/os/ccdefname.c src/lib/krb5/os/ccdefname.c *** src.old/lib/krb5/os/ccdefname.c Tue Aug 5 17:02:23 2003 --- src/lib/krb5/os/ccdefname.c Tue Aug 5 17:02:15 2003 *************** *** 32,39 **** --- 32,43 ---- #include #if defined(USE_CCAPI) + #if defined(__MACH__) && defined(__APPLE__) + #include + #else #include #endif + #endif #if defined(_WIN32) static int get_from_registry_indirect(char *name_buf, int name_size) *************** *** 197,202 **** --- 201,209 ---- cc_int32 ccerr = cc_initialize (&cc_context, ccapi_version_3, NULL, NULL); if (ccerr == ccNoError) { ccerr = cc_context_get_default_ccache_name (cc_context, &default_name); + } else { + sprintf(name_buf, "FILE:/tmp/krb5cc_%ld", (long) getuid()); + return 0; } if (ccerr == ccNoError) {