+++ /dev/null
-!include <Win32.Mak>\r
-\r
-# . is ...\pismere\athena\auth\krb5\src\ccapi\lib\win\r
-CCAPI = ..\..\r
-CO = $(CCAPI)\common\r
-COWIN = $(CCAPI)\common\win\r
-CCUTIL = $(CCAPI)\common\win\OldCC \r
-LIBDIR = $(CCAPI)\lib\r
-LIBWIN = $(LIBDIR)\win\r
-K5SRC = $(CCAPI)\..\r
-POSIX = $(K5SRC)\lib\krb5\posix\r
-OLDCC = $(LIBWIN)\OldCC\r
-\r
-INC = -I.. -I$(CO) -I$(COWIN) -I$(K5SRC)\include -I..\..\..\util\et -I$(OLDCC) \\r
- -I$(LIBWIN) -I$(CCUTIL)\r
-MIDLI = /I $(K5SRC)\include /I. /I$(COWIN) /I$(CO) \r
-\r
-!if "$(CPU)" == "i386"\r
-cflags = $(cflags) /EHsc /MDd -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 \\r
-$(INC) -D_CRT_SECURE_NO_WARNINGS\r
-!else\r
-cflags = $(cflags) /W3 -D_CRTAPI1= -D_CRTAPI2= $(INC)\r
-!endif\r
-\r
-!if "$(PREPROCESS)" == "P"\r
-cflags = $(cflags) -P\r
-!endif\r
-\r
-all : ccapi.dll\r
-\r
-common = cci_array_internal.obj cci_cred_union.obj cci_debugging.obj cci_identifier.obj \\r
- cci_message.obj cci_stream.obj \r
- \r
-commonwin = cci_os_debugging.obj \\r
- cci_os_identifier.obj \\r
- tls.obj \\r
- win-utils.obj\r
-\r
-dll = ccapi_ccache.obj \\r
- ccapi_ccache_iterator.obj \\r
- ccapi_context.obj \\r
- ccapi_context_change_time.obj \\r
- ccapi_credentials.obj \\r
- ccapi_credentials_iterator.obj \\r
- ccapi_ipc.obj \\r
- ccapi_string.obj \r
-\r
-dllwin = ccs_reply_s.obj \\r
- ccs_reply_proc.obj \\r
- ccs_request_c.obj \r
- \r
-dllwincxx = ccapi_os_ipc.obj \\r
- dllmain.obj\r
- \r
-oldcc = client.obj \\r
- rpc.obj \r
- \r
-utils = ccutils.obj\r
-\r
-utilscxx = init.obj \\r
- secure.obj \\r
- util.obj\r
-\r
-\r
-linkobjs = $(common) $(commonwin) $(dll) $(dllwin) $(dllwincxx) $(oldcc) $(utils) $(utilscxx)\r
-\r
-#includes = \r
-\r
-# Main program:\r
-ccapi.dll : $(linkobjs) ccapi.def\r
- $(link) $(linkdebug) $(conflags) -out:ccapi.dll /DEF:ccapi.def /implib:ccapi.lib $(dlllflags) \\r
- $(linkobjs) rpcrt4.lib kernel32.lib user32.lib $(conlibsdll) \r
-\r
-\r
-ccs_request.h ccs_request_c.c ccs_request_s.c : $(COWIN)\ccs_request.idl $(COWIN)\ccs_request.acf\r
- midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(cc) -cpp_opt "-E" \\r
- $(COWIN)\ccs_request.idl\r
-\r
-ccs_reply.h ccs_reply_c.c ccs_reply_s.c : $(COWIN)\ccs_reply.idl $(COWIN)\ccs_reply.acf\r
- midl $(MIDL_OPTIMIZATION) $(MIDLI) -oldnames -cpp_cmd $(cc) -cpp_opt "-E" -I. -I$(COWIN) \\r
- $(COWIN)\ccs_reply.idl\r
-\r
-$(common) : $(CO)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(CO)\$*.c\r
-\r
-$(commonwin) : $(COWIN)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(COWIN)\$*.c\r
-\r
-$(dll) : $(LIBDIR)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(LIBDIR)\$*.c\r
-\r
-$(dllwin) : $*.c ccs_reply.h ccs_request.h\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(LIBWIN)\$*.c\r
-\r
-$(dllwincxx) : $*.cxx ccs_reply.h ccs_request.h\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(LIBWIN)\$*.cxx\r
-\r
-$(oldcc) : $(OLDCC)\$*.cxx\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(OLDCC)\$*.cxx\r
-\r
-$(utils) : $(CCUTIL)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(CCUTIL)\$*.c\r
-\r
-$(utilscxx) : $(CCUTIL)\$*.cxx\r
- $(cc) $(cdebug) $(cflags) $(cvarsdll) $(CCUTIL)\$*.cxx\r
-\r
-\r
-\r
-# Clean up everything\r
-cleanall : clean\r
- -del *.dll\r
-\r
-# Clean up everything but the .EXEs\r
-clean :\r
- -del *.obj\r
- -del *.map\r
$(OUTPRE)ccapi_ipc.obj \\r
$(OUTPRE)ccapi_os_ipc.obj \\r
$(OUTPRE)ccapi_string.obj \\r
+ $(OUTPRE)ccapi_v2.obj \\r
$(OUTPRE)cci_array_internal.obj \\r
$(OUTPRE)cci_cred_union.obj \\r
$(OUTPRE)cci_debugging.obj \\r
+++ /dev/null
-!include <Win32.Mak>\r
-\r
-# . is ...\pismere\athena\auth\krb5\src\ccapi\server\win\r
-CCAPI = ..\..\r
-CO = $(CCAPI)\common\r
-COWIN = $(CCAPI)\common\win\r
-CCUTIL = $(CCAPI)\common\win\OldCC\r
-LIBDIR = $(CCAPI)\lib\r
-LIBWIN = $(CCAPI)\lib\win\r
-K5SRC = $(CCAPI)\..\r
-POSIX = $(K5SRC)\lib\krb5\posix\r
-\r
-INC = -I. -I.. -I$(CO) -I$(COWIN) -I$(K5SRC)\include -I..\..\..\util\et -I$(CCUTIL)\r
-\r
-!if "$(CPU)" == "i386"\r
-cflags = $(cflags) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 \\r
-$(INC) -MTd\r
-!else\r
-cflags = $(cflags) /W3 -D_CRTAPI1= -D_CRTAPI2= $(INC)\r
-!endif\r
-\r
-all : server\r
-\r
-server : server.exe\r
-\r
-common = cci_array_internal.obj cci_cred_union.obj cci_debugging.obj cci_identifier.obj \\r
- cci_message.obj cci_stream.obj \r
- \r
-commonwin = cci_os_debugging.obj \\r
- cci_os_identifier.obj \\r
- tls.obj \\r
- win-utils.obj\r
-\r
-ccutils = ccutils.obj \r
-\r
-ccutilscxx = opts.obj util.obj secure.obj init.obj\r
-\r
-dll = ccapi_string.obj\r
-\r
-srv = ccs_array.obj ccs_cache_collection.obj ccs_callback.obj ccs_ccache.obj \\r
- ccs_ccache_iterator.obj ccs_client.obj \\r
- ccs_credentials.obj ccs_credentials_iterator.obj ccs_list.obj ccs_list_internal.obj \\r
- ccs_lock.obj ccs_lock_state.obj ccs_pipe.obj ccs_server.obj \r
-\r
-srvwin = ccs_os_pipe.obj ccs_reply_c.obj \\r
- ccs_request_proc.obj ccs_win_pipe.obj\r
-\r
-srvwincpp = ccs_os_server.obj ccs_request_s.obj WorkItem.obj WorkQueue.obj\r
- \r
-linkobjs = $(common) $(commonwin) $(ccutils) $(ccutilscxx) \\r
- $(srv) $(srvwin) $(srvwincpp)\r
-\r
-includes = ccs_reply.h ccs_request.h\r
-\r
-# Main program:\r
-server.exe : $(linkobjs) \r
-# $(link) $(linkdebug) $(conflags) -MTd -out:ccapiserver.exe $(linkobjs) \\r
- $(link) $(linkdebug) $(conflags) -out:ccapiserver.exe $(linkobjs) \\r
- rpcrt4.lib advapi32.lib ws2_32.lib user32.lib\r
-\r
-\r
-ccs_request.h ccs_request_s.cpp : $(COWIN)\ccs_request.idl $(COWIN)\ccs_request.acf\r
- midl $(MIDL_OPTIMIZATION) -oldnames -cpp_cmd $(cc) -cpp_opt "-E" -I. -I$(COWIN) -sstub \\r
- ccs_request_s.cpp $(COWIN)\ccs_request.idl\r
-\r
-ccs_reply.h ccs_reply_c.c : $(COWIN)\ccs_reply.idl $(COWIN)\ccs_reply.acf\r
- midl $(MIDL_OPTIMIZATION) -oldnames -cpp_cmd $(cc) -cpp_opt "-E" -I. -I$(COWIN) \\r
- $(COWIN)\ccs_reply.idl\r
-\r
-$(common) : $(CO)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(CO)\$*.c\r
-\r
-$(commonwin) : $(COWIN)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(COWIN)\$*.c\r
-\r
-$(ccutils) : $(CCUTIL)\$*.c\r
- $(cc) $(cdebug) $(cflags) $(CCUTIL)\$*.c\r
-\r
-$(ccutilscxx) : $(CCUTIL)\$*.cxx\r
- $(cc) $(cdebug) $(cflags) $(CCUTIL)\$*.cxx\r
-\r
-$(srv) : ..\$*.c\r
- $(cc) $(cdebug) $(cflags) ..\$*.c\r
-\r
-$(srvwin) : $*.c $(includes) \r
- $(cc) $(cdebug) $(cflags) $*.c\r
-\r
-$(srvwincpp) : $*.cpp\r
- $(cc) $(cdebug) $(cflags) $*.cpp\r
-\r
-\r
-# Clean up everything\r
-cleanall : clean\r
- -del *.exe\r
-\r
-# Clean up everything but the .EXEs\r
-clean :\r
- -del *.obj\r
- -del *.map\r
- -del ccs_request_s.c\r
- -del ccs_request_c.c\r
- -del ccs_request.h\r
- -del ccs_reply_s.c\r
- -del ccs_reply_c.c\r
- -del ccs_reply.h\r
+++ /dev/null
-# run with "make all" to create CCAPI tests in "/tmp/ccapi_test"
-# run resulting tests with "sh test_ccapi.sh"
-
-CC = gcc
-LIBS = -lkrb5
-
-SRCDIR = src
-DSTROOT = /tmp
-OBJDIR = $(DSTROOT)/ccapi_intermediates
-DSTDIR = $(DSTROOT)/ccapi_test
-TESTDIR = $(DSTDIR)/tests
-
-SCRIPT_NAME = test_ccapi.sh
-
-_OBJECTS = test_ccapi_ccache \
- test_ccapi_check \
- test_ccapi_constants \
- test_ccapi_context \
- test_ccapi_globals \
- test_ccapi_iterators \
- test_ccapi_log \
- test_ccapi_util \
- test_ccapi_v2
-
-OBJECTS = $(patsubst %,$(OBJDIR)/%.o,$(_OBJECTS))
-
-TEST_NAMES = test_constants \
- test_cc_initialize \
- test_cc_context_release \
- test_cc_context_get_change_time \
- test_cc_context_get_default_ccache_name \
- test_cc_context_open_ccache \
- test_cc_context_open_default_ccache \
- test_cc_context_create_ccache \
- test_cc_context_create_default_ccache \
- test_cc_context_create_new_ccache \
- test_cc_context_new_ccache_iterator \
- test_cc_context_compare \
- test_cc_ccache_release \
- test_cc_ccache_destroy \
- test_cc_ccache_set_default \
- test_cc_ccache_get_credentials_version \
- test_cc_ccache_get_name \
- test_cc_ccache_get_principal \
- test_cc_ccache_set_principal \
- test_cc_ccache_store_credentials \
- test_cc_ccache_remove_credentials \
- test_cc_ccache_new_credentials_iterator \
- test_cc_ccache_get_change_time \
- test_cc_ccache_get_last_default_time \
- test_cc_ccache_move \
- test_cc_ccache_compare \
- test_cc_ccache_get_kdc_time_offset \
- test_cc_ccache_set_kdc_time_offset \
- test_cc_ccache_clear_kdc_time_offset \
- test_cc_ccache_iterator_next \
- test_cc_credentials_iterator_next\
- test_cc_shutdown \
- test_cc_get_change_time \
- test_cc_open \
- test_cc_create \
- test_cc_close \
- test_cc_destroy \
- test_cc_get_cred_version \
- test_cc_get_name \
- test_cc_get_principal \
- test_cc_set_principal \
- test_cc_store \
- test_cc_remove_cred \
- test_cc_seq_fetch_NCs_begin \
- test_cc_seq_fetch_NCs_next \
- test_cc_seq_fetch_creds_begin \
- test_cc_seq_fetch_creds_next \
- test_cc_get_NC_info
-
-
-TEST_OBJECTS = $(patsubst %,$(OBJDIR)/%.o,$(TEST_NAMES))
-
-all: setup-test-dir simple_lock_test build-base build-tests link-tests copy-script success-message
-
-# compile base files used by all tests
-build-base: $(OBJECTS)
-
-# compile each test
-build-tests: $(TEST_OBJECTS)
-
-# rule to compile src files
-$(OBJDIR)/%.o: %.c
- $(CC) -c -o $@ $<
-
-# Make a build directory
-setup-test-dir:
- @echo "Removing old destination directory... $(DSTDIR)"
- if [ -d "$(DSTDIR)" ]; then chmod -R u+w "$(DSTDIR)" && rm -rf "$(DSTDIR)"; fi
- mkdir -p "$(TESTDIR)"
- if [ -d "$(OBJDIR)" ]; then chmod -R u+w "$(OBJDIR)" && rm -rf "$(OBJDIR)"; fi
- mkdir -p "$(OBJDIR)"
-
-link-tests: $(TEST_NAMES)
-
-$(TEST_NAMES): $(TEST_OBJECTS)
- $(CC) -o $(TESTDIR)/$@ $(OBJDIR)/$@.o $(OBJECTS) $(LIBS)
-
-simple_lock_test:
- $(CC) -o $(TESTDIR)/simple_lock_test simple_lock_test.c test_ccapi_log.c $(LIBS)
-
-copy-script:
- cp $(SCRIPT_NAME) $(DSTDIR)/$(SCRIPT_NAME)
-
-success-message:
- @echo
- @echo "CCAPI tests created in $(DSTDIR)"
-
-.PHONY: clean
-
-clean:
- -rm -rf "$(OBJDIR)"
-
-
myfulldir=ccapi$(S)test
mydir=ccapi$(S)test
BUILDTOP=..$(S)..
+CCAPI=$(BUILDTOP)$(S)CCAPI
!if defined(KRB5_KFW_COMPILE)
KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
# Because all the sources are in .,
# the only includes we need are to directories outside of ccapi.
LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)$(S)include /I$(BUILDTOP)$(S)include$(S)krb5 $(KFWINC) \
- -I$(BUILDTOP)$(S)util$(S)et /I.
+ -I$(BUILDTOP)$(S)util$(S)et /I. -I$(CCAPI)$(S)COMMON -I$(CCAPI)$(S)LIB
# run with "make all" to create CCAPI tests in "/tmp/ccapi_test"
# run resulting tests with "sh test_ccapi.sh"
##DOS## cci_types.h \
##DOS## win-utils.h
+##DOS##LIBSRC=ccapi_ccache.c \
+##DOS## ccapi_ccache_iterator.c \
+##DOS## ccapi_context.c \
+##DOS## ccapi_context_change_time.c \
+##DOS## ccapi_ipc.c \
+##DOS## ccapi_credentials.c \
+##DOS## ccapi_credentials_iterator.c \
+##DOS## ccapi_v2.c
+
+##DOS##COMSRC=cci_cred_union.c \
+##DOS## cci_identifier.c \
+##DOS## cci_message.c \
+##DOS## cci_stream.c
+
+##DOS##COWSRC=cci_os_identifier.c
+
SRCDIR = .
DSTROOT = $(SRCDIR)
OBJDIR = $(DSTROOT)$(S)ccapi_intermediates
DSTDIR = $(DSTROOT)$(S)ccapi_test
TESTDIR = $(DSTDIR)$(S)tests
+SRCTMP = $(SRCDIR)\srctmp
SCRIPT_NAME = test_ccapi.sh
$(OUTPRE)test_ccapi_log.$(OBJEXT) \
$(OUTPRE)test_ccapi_util.$(OBJEXT)
-PINGOBJS = $(OUTPRE)ccs_request_c.$(OBJEXT) \
+PINGOBJS = $(OUTPRE)ccapi_ccache.$(OBJEXT) \
+ $(OUTPRE)ccapi_ccache_iterator.$(OBJEXT) \
+ $(OUTPRE)ccapi_context.$(OBJEXT) \
+ $(OUTPRE)ccapi_context_change_time.$(OBJEXT) \
+ $(OUTPRE)ccapi_ipc.$(OBJEXT) \
+ $(OUTPRE)ccapi_credentials.$(OBJEXT) \
+ $(OUTPRE)ccapi_credentials_iterator.$(OBJEXT) \
+ $(OUTPRE)ccapi_v2.$(OBJEXT) \
+ $(OUTPRE)cci_cred_union.$(OBJEXT) \
+ $(OUTPRE)cci_identifier.$(OBJEXT) \
+ $(OUTPRE)cci_os_identifier.$(OBJEXT) \
+ $(OUTPRE)cci_message.$(OBJEXT) \
+ $(OUTPRE)cci_stream.$(OBJEXT) \
+ $(OUTPRE)ccs_request_c.$(OBJEXT) \
$(OUTPRE)pingtest.$(OBJEXT) \
$(OBJECTS)
mkdir -p "$(OBJDIR)"
## The same trick as used in TEST_NAMES to run an action on each element ofthe list WINH:
-setup-windows: $(WINH)
+setup-windows: $(WINH) $(LIBSRC) $(COMSRC) $(COWSRC)
if NOT exist $(TESTDIR) mkdir $(TESTDIR)
if NOT exist $(OBJDIR) mkdir $(OBJDIR)
set LINK = link
$(WINH):
copy ..\lib\win\srctmp\$@ .
+$(LIBSRC):
+ copy ..\lib\$@ .
+
+$(COMSRC):
+ copy ..\common\$@ .
+
+$(COWSRC):
+ copy ..\common\win\$@ .
+
# This rule assumes that nmake in ..\lib\win\ has already run.
$(OUTPRE)pingtest.exe: $(OBJECTS) $(PINGOBJS)
# There doesn't appear to be any way to examine a variable and return a value
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <malloc.h>
+#include "k5-platform.h" /* pull in asprintf decl/defn */
#include "test_ccapi_util.h"
#include <string.h>
+#include "k5-platform.h" /* pull in asprintf decl/defn */\r
#include "test_ccapi_v2.h"
#include <limits.h>
#include <time.h>
cc_result check_once_cc_seq_fetch_NCs_next(apiCB *context, ccache_cit *iterator, cc_uint32 expected_count, cc_result expected_err, const char *description) {
cc_result err = CC_NOERROR;
- BEGIN_CHECK_ONCE(description);
-
cc_result possible_return_values[5] = {
CC_NOERROR,
CC_END,
ccache_p *ccache = NULL;
cc_uint32 actual_count = 0;
+ BEGIN_CHECK_ONCE(description);
+
while (!err) {
err = cc_seq_fetch_NCs_next(context, &ccache, iterator);
if (ccache) {
cc_result err = CC_NOERROR;
infoNC **info = NULL;
- BEGIN_CHECK_ONCE(description);
-
cc_result possible_return_values[4] = {
CC_NOERROR,
CC_BAD_PARM,
cc_uint32 actual_count = 0;
+ BEGIN_CHECK_ONCE(description);
+
err = cc_get_NC_info(context, &info);
for (actual_count = 0; !err && info[actual_count]; actual_count++) {