svn rev #22218: branches/krb5-1-7/src/ include/ include/krb5/ lib/krb5/ lib/krb5/krb/

tlyu@MIT.EDU tlyu at MIT.EDU
Tue Apr 14 17:07:16 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22218
Commit By: tlyu
Log Message:
ticket: 6407
version_fixed: 1.7

pull up r22078 from trunk

 ------------------------------------------------------------------------
 r22078 | ghudson | 2009-03-11 18:11:06 -0400 (Wed, 11 Mar 2009) | 9 lines
 Changed paths:
    M /trunk/src/include/k5-int.h
    M /trunk/src/include/krb5/krb5.hin
    M /trunk/src/lib/krb5/krb/kerrs.c
    M /trunk/src/lib/krb5/libkrb5.exports

 ticket: 6407
 subject: Make a working krb5_copy_error_message
 target_version: 1.7
 tags: pullup

 The krb5_copy_error_state macro wasn't used, didn't work, and didn't
 need to be a macro.  Replace it with an exported API function named
 krb5_copy_error_message.


Changed Files:
U   branches/krb5-1-7/src/include/k5-int.h
U   branches/krb5-1-7/src/include/krb5/krb5.hin
U   branches/krb5-1-7/src/lib/krb5/krb/kerrs.c
U   branches/krb5-1-7/src/lib/krb5/libkrb5.exports
Modified: branches/krb5-1-7/src/include/k5-int.h
===================================================================
--- branches/krb5-1-7/src/include/k5-int.h	2009-04-14 21:07:13 UTC (rev 22217)
+++ branches/krb5-1-7/src/include/k5-int.h	2009-04-14 21:07:15 UTC (rev 22218)
@@ -2326,9 +2326,6 @@
 extern int krb5int_crypto_init (void);
 extern int krb5int_prng_init(void);
 
-#define krb5_copy_error_state(CTX, OCTX) \
-	krb5int_set_error(&(CTX)->errinfo, (OCTX)->errinfo.code, "%s", (OCTX)->errinfo.msg)
-
 /*
  * Referral definitions, debugging hooks, and subfunctions.
  */

Modified: branches/krb5-1-7/src/include/krb5/krb5.hin
===================================================================
--- branches/krb5-1-7/src/include/krb5/krb5.hin	2009-04-14 21:07:13 UTC (rev 22217)
+++ branches/krb5-1-7/src/include/krb5/krb5.hin	2009-04-14 21:07:15 UTC (rev 22218)
@@ -2490,6 +2490,9 @@
     __attribute__((__format__(__printf__, 3, 0)))
 #endif
     ;
+void KRB5_CALLCONV
+krb5_copy_error_message (krb5_context, krb5_context);
+
 /*
  * The behavior of krb5_get_error_message is only defined the first
  * time it is called after a failed call to a krb5 function using the

Modified: branches/krb5-1-7/src/lib/krb5/krb/kerrs.c
===================================================================
--- branches/krb5-1-7/src/lib/krb5/krb/kerrs.c	2009-04-14 21:07:13 UTC (rev 22217)
+++ branches/krb5-1-7/src/lib/krb5/krb/kerrs.c	2009-04-14 21:07:15 UTC (rev 22218)
@@ -75,6 +75,20 @@
 #endif
 }
 
+/* Set the error message state of dest_ctx to that of src_ctx. */
+void KRB5_CALLCONV
+krb5_copy_error_message (krb5_context dest_ctx, krb5_context src_ctx)
+{
+    if (dest_ctx == src_ctx)
+	return;
+    if (src_ctx->err.msg) {
+	krb5int_set_error(&dest_ctx->err, src_ctx->err.code, "%s",
+			  src_ctx->err.msg);
+    } else {
+	krb5int_clear_error(dest_ctx);
+    }
+}
+
 const char * KRB5_CALLCONV
 krb5_get_error_message (krb5_context ctx, krb5_error_code code)
 {

Modified: branches/krb5-1-7/src/lib/krb5/libkrb5.exports
===================================================================
--- branches/krb5-1-7/src/lib/krb5/libkrb5.exports	2009-04-14 21:07:13 UTC (rev 22217)
+++ branches/krb5-1-7/src/lib/krb5/libkrb5.exports	2009-04-14 21:07:15 UTC (rev 22218)
@@ -172,6 +172,7 @@
 krb5_copy_context
 krb5_copy_creds
 krb5_copy_data
+krb5_copy_error_message
 krb5_copy_keyblock
 krb5_copy_keyblock_contents
 krb5_copy_principal




More information about the cvs-krb5 mailing list