diff options
| author | Greg Hudson <ghudson@mit.edu> | 2009-03-11 22:11:06 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2009-03-11 22:11:06 +0000 |
| commit | ef8186907c3d3e29260898dd484a18504ba5848e (patch) | |
| tree | 1ee7d4fa412d2e58adffb8b645fc5497aba4ee6d /src/lib | |
| parent | 3a02ca0ae2381f7ea7bc120c62d3154cc33350b9 (diff) | |
Make a working krb5_copy_error_message
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.
ticket: 6407
target_version: 1.7
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22078 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/krb5/krb/kerrs.c | 14 | ||||
| -rw-r--r-- | src/lib/krb5/libkrb5.exports | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/kerrs.c b/src/lib/krb5/krb/kerrs.c index 77f497688..647076485 100644 --- a/src/lib/krb5/krb/kerrs.c +++ b/src/lib/krb5/krb/kerrs.c @@ -75,6 +75,20 @@ krb5_vset_error_message (krb5_context ctx, krb5_error_code code, #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) { diff --git a/src/lib/krb5/libkrb5.exports b/src/lib/krb5/libkrb5.exports index a6b892983..c41d2e811 100644 --- a/src/lib/krb5/libkrb5.exports +++ b/src/lib/krb5/libkrb5.exports @@ -172,6 +172,7 @@ krb5_copy_checksum krb5_copy_context krb5_copy_creds krb5_copy_data +krb5_copy_error_message krb5_copy_keyblock krb5_copy_keyblock_contents krb5_copy_principal |
