Rename interface to krb5_524_convert_creds, export it from krb5 library.
authorKen Raeburn <raeburn@mit.edu>
Wed, 28 May 2003 02:16:30 +0000 (02:16 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 28 May 2003 02:16:30 +0000 (02:16 +0000)
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

12 files changed:
src/include/ChangeLog
src/include/k5-int.h
src/include/krb5.hin
src/krb524/ChangeLog
src/krb524/Makefile.in
src/krb524/k524init.c
src/lib/ChangeLog
src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/conv_creds.c
src/lib/krb5/os/ChangeLog
src/lib/krb5/os/send524.c
src/lib/krb5_32.def

index 301d9b83356dcbfecec5fa44b4599537fe2fe829..3ed279580a1fce45df1c4db541ab48fd31d34288 100644 (file)
@@ -1,5 +1,12 @@
 2003-05-27  Ken Raeburn  <raeburn@mit.edu>
 
+       * 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.
 
index 73f0dac335f9a4927c62bf6cd91e68e9ef7fbc6d..2139b86d7e04671b3817b93d46153a424f12c144 100644 (file)
@@ -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);
index 96fd0c89925300f884236ac5fc32287eddcdbf97..1f98c3d3bc9fae3d8eb14a6f3efb2f3e81ee9f12 100644 (file)
@@ -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
index 1e58058ef2827375aa96a7d2470de55adf4f72b6..e8a301d0c68cffaa40e03d7c25f75eb6e704c263 100644 (file)
@@ -1,3 +1,10 @@
+2003-05-27  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * conv_creds.c, encode.c, globals.c, sendmsg.c: Deleted.  Contents
index d904c70cded1dc54d64ea54a0aa6be519213d956..41f8ef941a8b9a6ffb7a5134fb31f249441931ed 100644 (file)
@@ -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::
index c9255c6d5c98d83eb11d85cca881ee072e6077ef..df64020d10e37619d9f8d3e9bcacc44e21489c5f 100644 (file)
@@ -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);
      }
index 2051533052532abdf3837c07cdc3b488452e4102..63f623222f4ad95cdcb09abaf2e6ae0fca03363e 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-27  Ken Raeburn  <raeburn@mit.edu>
+
+       * krb5_32.def: Add krb5_524_convert_creds.
+
 2003-05-08  Sam Hartman  <hartmans@mit.edu>
 
        * krb5_32.def: Add krb5_c_string_to_key_with_params
index 29fdca9ce9909b8871c7db0592b34243c4292f1f..531a378d4c6d1b5a90333f504de9e9001f669b33 100644 (file)
@@ -1,3 +1,10 @@
+2003-05-27  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <hartmans@mit.edu>
 
        * gic_keytab.c (krb5_get_in_tkt_with_keytab): as below
index bf694c33702ef5d7bee27f2421ce078dc75d8dbe..a4e5abc946271ad6787c2e613ab92665dbf8291d 100644 (file)
@@ -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
index a99de43e1baf5a4595020e3761bf72a22eefbf0b..220468c9ce0176feb65754b4ac332394f67240e6 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-27  Ken Raeburn  <raeburn@mit.edu>
+
+       * send524.c (krb5int_524_sendto_kdc): Enable support on Windows
+       always.
+
 2003-05-24  Ken Raeburn  <raeburn@mit.edu>
 
        * send524.c: New file, moved from krb524/sendmsg.c.  Rename
index f126555522d454ac89720b16ae9fc9002dc4d5b1..0ca8e93c33236bc6ff597729380ded3594906d58 100644 (file)
@@ -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;
index db136c44a3e1c31490d46c85c424102b3e3e0137..78df9a3992e9a34afe9498d8686629fdabc29364 100644 (file)
@@ -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):