diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-06-11 14:35:35 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-06-14 15:52:29 -0400 |
commit | 95cc3f4be93d3cb5bb28bb3787f0aace4edb3124 (patch) | |
tree | fb607e88111eba1618dc93880fea2cb2fe8da6c3 /src/tests | |
parent | 9a3ba9ca00e73adc3fb17ce8afa532076768023b (diff) | |
download | sssd-95cc3f4be93d3cb5bb28bb3787f0aace4edb3124.tar.gz sssd-95cc3f4be93d3cb5bb28bb3787f0aace4edb3124.tar.bz2 sssd-95cc3f4be93d3cb5bb28bb3787f0aace4edb3124.zip |
Use Kerberos context in KRB5_DEBUG
Passing Kerberos context to sss_krb5_get_error_message will allow us to
get better error messages.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/krb5_child-test.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/tests/krb5_child-test.c b/src/tests/krb5_child-test.c index 015bd39a..fa9374c2 100644 --- a/src/tests/krb5_child-test.c +++ b/src/tests/krb5_child-test.c @@ -43,24 +43,18 @@ extern struct sss_krb5_cc_be file_cc; extern struct sss_krb5_cc_be dir_cc; static krb5_context krb5_error_ctx; -#define KRB5_DEBUG(level, krb5_error) do { \ - const char * __krb5_error_msg; \ - __krb5_error_msg = sss_krb5_get_error_message(krb5_error_ctx, krb5_error); \ - DEBUG(level, ("%d: [%d][%s]\n", __LINE__, krb5_error, __krb5_error_msg)); \ - sss_log(SSS_LOG_ERR, "%s", __krb5_error_msg); \ - sss_krb5_free_error_message(krb5_error_ctx, __krb5_error_msg); \ -} while(0) +#define KRB5_CHILD_TEST_DEBUG(level, error) KRB5_DEBUG(level, krb5_error_ctx, error) #define CHECK_KRET(kret, err) do { \ if (kret) { \ - KRB5_DEBUG(SSSDBG_OP_FAILURE, kret); \ + KRB5_CHILD_TEST_DEBUG(SSSDBG_OP_FAILURE, kret); \ return err; \ } \ } while(0) \ #define CHECK_KRET_L(kret, err, label) do { \ if (kret) { \ - KRB5_DEBUG(SSSDBG_OP_FAILURE, kret); \ + KRB5_CHILD_TEST_DEBUG(SSSDBG_OP_FAILURE, kret); \ goto label; \ } \ } while(0) \ @@ -321,7 +315,7 @@ printtime(krb5_timestamp ts) kret = krb5_timestamp_to_sfstring(ts, timestring, BUFSIZ, &fill); if (kret) { - KRB5_DEBUG(SSSDBG_OP_FAILURE, kret); + KRB5_CHILD_TEST_DEBUG(SSSDBG_OP_FAILURE, kret); } printf("%s", timestring); } |