From: Ken Raeburn Date: Wed, 28 May 2003 02:16:30 +0000 (+0000) Subject: Rename interface to krb5_524_convert_creds, export it from krb5 library. X-Git-Tag: krb5-1.4-beta1~914 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=125e627c402c08c5848bb7a67223397b42779ba1;p=krb5.git Rename interface to krb5_524_convert_creds, export it from krb5 library. Provide old names as functions for UNIX/MacOS binary compatibility, and deprecated macros for source code compatibility. (For Windows, we'll still need a krb524.dll, and it can worry about providing the old names.) Enable support on Windows always. ticket: 1491 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15513 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 301d9b833..3ed279580 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,12 @@ 2003-05-27 Ken Raeburn + * k5-int.h (KRB524_SERVICE, KRB524_PORT): Moved here... + * krb5.h: ...from here. + (krb5_524_convert_creds): Renamed from krb524_convert_creds_kdc, + fixed calling convention spec. + (krb524_convert_creds_kdc, krb524_init_ets) [KRB5_DEPRECATED]: New + macros. + * Makefile.in (clean-windows): Remove new "timestamp" file when cleaning up. diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 73f0dac33..2139b86d7 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1683,6 +1683,9 @@ krb5_error_code KRB5_CALLCONV krb5int_accessor in fact a krb4 ticket, so we don't want to drag in the krb4 support just to enable this. */ +#define KRB524_SERVICE "krb524" +#define KRB524_PORT 4444 + /* v4lifetime.c */ extern krb5_int32 krb5int_krb_life_to_time(krb5_int32, int); extern int krb5int_krb_time_to_life(krb5_int32, krb5_int32); diff --git a/src/include/krb5.hin b/src/include/krb5.hin index 96fd0c899..1f98c3d3b 100644 --- a/src/include/krb5.hin +++ b/src/include/krb5.hin @@ -1661,13 +1661,14 @@ krb5_error_code KRB5_CALLCONV krb5_524_conv_principal (krb5_context context, krb5_const_principal princ, char *name, char *inst, char *realm); -#define KRB524_SERVICE "krb524" -#define KRB524_PORT 4444 - struct credentials; -int krb524_convert_creds_kdc - (krb5_context context, krb5_creds *v5creds, - struct credentials *v4creds); +int KRB5_CALLCONV krb5_524_convert_creds + (krb5_context context, krb5_creds *v5creds, + struct credentials *v4creds); +#if KRB5_DEPRECATED +#define krb524_convert_creds_kdc krb5_524_convert_creds +#define krb524_init_ets() (0) +#endif /* libkt.spec */ #if KRB5_PRIVATE diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 1e58058ef..e8a301d0c 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,10 @@ +2003-05-27 Ken Raeburn + + * k524init.c (main): Call krb5_524_convert_creds instead of + krb524_convert_creds_kdc. + + * Makefile.in ($(OUTPRE)k524init.exe): Don't depend on K524DEP. + 2003-05-24 Ken Raeburn * conv_creds.c, encode.c, globals.c, sendmsg.c: Deleted. Contents diff --git a/src/krb524/Makefile.in b/src/krb524/Makefile.in index d904c70cd..41f8ef941 100644 --- a/src/krb524/Makefile.in +++ b/src/krb524/Makefile.in @@ -85,7 +85,7 @@ k524init: $(CLIENT_OBJS) $(KRB5_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(K524LIB): $(STLIBOBJS) $(K4LIB) $(KLIB) link $(DLL_LINKOPTS) -def:$(K524DEF) -out:$*.dll $** $(WINLIBS) -$(OUTPRE)k524init.exe: $(OUTPRE)k524init.$(OBJEXT) $(K524DEP) $(KLIB) $(K4LIB) $(CLIB) $(BUILDTOP)\util\windows\$(OUTPRE)getopt.lib +$(OUTPRE)k524init.exe: $(OUTPRE)k524init.$(OBJEXT) $(KLIB) $(K4LIB) $(CLIB) $(BUILDTOP)\util\windows\$(OUTPRE)getopt.lib link $(EXE_LINKOPTS) -out:$@ $** $(WINLIBS) install-unix:: diff --git a/src/krb524/k524init.c b/src/krb524/k524init.c index c9255c6d5..df64020d1 100644 --- a/src/krb524/k524init.c +++ b/src/krb524/k524init.c @@ -149,7 +149,8 @@ int main(argc, argv) exit(1); } - if ((code = krb524_convert_creds_kdc(context, v5creds, &v4creds))) { + if ((code = krb5_524_convert_creds(context, v5creds, &v4creds))) { + fprintf(stderr, "error code => %ld 0x%x <=\n", code, code); com_err(prog, code, "converting to V4 credentials"); exit(1); } diff --git a/src/lib/ChangeLog b/src/lib/ChangeLog index 205153305..63f623222 100644 --- a/src/lib/ChangeLog +++ b/src/lib/ChangeLog @@ -1,3 +1,7 @@ +2003-05-27 Ken Raeburn + + * krb5_32.def: Add krb5_524_convert_creds. + 2003-05-08 Sam Hartman * krb5_32.def: Add krb5_c_string_to_key_with_params diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 29fdca9ce..531a378d4 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,10 @@ +2003-05-27 Ken Raeburn + + * conv_creds.c: Enable support on Windows always. + (krb5_524_convert_creds): Renamed from krb524_convert_creds_kdc. + (krb524_convert_creds_kdc, krb524_init_ets) [!_WIN32]: Backwards + compatibility functions. + 2003-05-27 Sam Hartman * gic_keytab.c (krb5_get_in_tkt_with_keytab): as below diff --git a/src/lib/krb5/krb/conv_creds.c b/src/lib/krb5/krb/conv_creds.c index bf694c337..a4e5abc94 100644 --- a/src/lib/krb5/krb/conv_creds.c +++ b/src/lib/krb5/krb/conv_creds.c @@ -27,7 +27,7 @@ #include "port-sockets.h" #include "socket-utils.h" -#ifdef KRB5_KRB4_COMPAT +#if defined(KRB5_KRB4_COMPAT) || defined(_WIN32) /* yuck */ #include "kerberosIV/krb.h" #ifdef USE_CCAPI @@ -44,9 +44,9 @@ static krb5_error_code krb524_convert_creds_plain static int decode_v4tkt (struct ktext *v4tkt, char *buf, unsigned int *encoded_len); -krb5_error_code -krb524_convert_creds_kdc(krb5_context context, krb5_creds *v5creds, - CREDENTIALS *v4creds) +krb5_error_code KRB5_CALLCONV +krb5_524_convert_creds(krb5_context context, krb5_creds *v5creds, + CREDENTIALS *v4creds) { krb5_error_code ret; krb5_data reply; @@ -250,11 +250,28 @@ static int decode_v4tkt(v4tkt, buf, encoded_len) #else /* no krb4 compat */ -krb5_error_code +krb5_error_code KRB5_CALLCONV +krb5_524_convert_creds(krb5_context context, krb5_creds *v5creds, + struct credentials *v4creds) +{ + return KRB524_KRB4_DISABLED; +} + +#endif + +/* These may be needed for object-level backwards compatibility on Mac + OS and UNIX, but Windows should be okay. */ +#ifndef _WIN32 +#undef krb524_convert_creds_kdc +krb5_error_code KRB5_CALLCONV krb524_convert_creds_kdc(krb5_context context, krb5_creds *v5creds, struct credentials *v4creds) { - return KRB524_KRB4_DISABLED; + return krb5_524_convert_creds(context, v5creds, v4creds); } +#undef krb524_init_ets +void KRB5_CALLCONV krb524_init_ets () +{ +} #endif diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index a99de43e1..220468c9c 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +2003-05-27 Ken Raeburn + + * send524.c (krb5int_524_sendto_kdc): Enable support on Windows + always. + 2003-05-24 Ken Raeburn * send524.c: New file, moved from krb524/sendmsg.c. Rename diff --git a/src/lib/krb5/os/send524.c b/src/lib/krb5/os/send524.c index f12655552..0ca8e93c3 100644 --- a/src/lib/krb5/os/send524.c +++ b/src/lib/krb5/os/send524.c @@ -65,7 +65,7 @@ krb5int_524_sendto_kdc (context, message, realm, reply, addr, addrlen) struct sockaddr *addr; socklen_t *addrlen; { -#ifdef KRB5_KRB4_COMPAT +#if defined(KRB5_KRB4_COMPAT) || defined(_WIN32) /* yuck! */ int i; struct addrlist al = ADDRLIST_INIT; struct servent *serv; diff --git a/src/lib/krb5_32.def b/src/lib/krb5_32.def index db136c44a..78df9a399 100644 --- a/src/lib/krb5_32.def +++ b/src/lib/krb5_32.def @@ -231,6 +231,10 @@ krb5_set_password_using_ccache krb5_verify_init_creds_opt_init krb5_verify_init_creds_opt_set_ap_req_nofail + krb5_524_convert_creds +; Don't add krb524_convert_creds_kdc or krb524_init_ets here; +; they've never been exported by this library, and are deprecated. -KR + krb5int_accessor ; INTERNAL (to end all internals) ; To Add (exported on Mac OS X):