From: Ken Raeburn Date: Thu, 7 Mar 2002 00:29:07 +0000 (+0000) Subject: more verbose reporting of unexpected errors X-Git-Tag: krb5-1.3-alpha1~855 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba0bbba85281cf86ae9fff65a6632f0910db8478;p=krb5.git more verbose reporting of unexpected errors git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14235 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/testing/util/ChangeLog b/src/kadmin/testing/util/ChangeLog index 4845d653d..5c3f1068a 100644 --- a/src/kadmin/testing/util/ChangeLog +++ b/src/kadmin/testing/util/ChangeLog @@ -1,3 +1,8 @@ + + * tcl_kadm5.c (unparse_err): Print error message, not just number, + to stderr for unrecognized error code. + * tcl_ovsec_kadm.c (unparse_err): Likewise. + 2001-09-01 Ken Raeburn * Makefile.in (SRCS): All files live in srcdir. diff --git a/src/kadmin/testing/util/tcl_kadm5.c b/src/kadmin/testing/util/tcl_kadm5.c index 9e0e2ea25..abc39b07e 100644 --- a/src/kadmin/testing/util/tcl_kadm5.c +++ b/src/kadmin/testing/util/tcl_kadm5.c @@ -405,9 +405,11 @@ static Tcl_DString *unparse_err(kadm5_ret_t code) case KRB5_CONFIG_BADFORMAT: code_string = "KRB5_CONFIG_BADFORMAT"; break; case EINVAL: code_string = "EINVAL"; break; case ENOENT: code_string = "ENOENT"; break; - default: - fprintf(stderr, "**** CODE %ld ***\n", (long) code); - code_string = "UNKNOWN"; break; + default: + fprintf(stderr, "**** CODE %d (%s) ***\n", code, + error_message (code)); + code_string = "UNKNOWN"; + break; } error_string = error_message(code); diff --git a/src/kadmin/testing/util/tcl_ovsec_kadm.c b/src/kadmin/testing/util/tcl_ovsec_kadm.c index b8a39bde2..004b5d134 100644 --- a/src/kadmin/testing/util/tcl_ovsec_kadm.c +++ b/src/kadmin/testing/util/tcl_ovsec_kadm.c @@ -374,7 +374,11 @@ static Tcl_DString *unparse_err(ovsec_kadm_ret_t code) case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN: code_string = "KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN"; break; case EINVAL: code_string = "EINVAL"; break; case ENOENT: code_string = "ENOENT"; break; - default: fprintf(stderr, "**** CODE %ld ***\n", (long) code); code_string = "UNKNOWN"; break; + default: + fprintf(stderr, "**** CODE %d (%s) ***\n", code, + error_message (code)); + code_string = "UNKNOWN"; + break; } error_string = error_message(code);