From dfec91b8e9c23f0e1a214f810498879f8620a4f8 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 13 Apr 2007 05:31:24 +0000 Subject: [PATCH] Provide more detailed error message for 'client not found in kdb' git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19455 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/get_in_tkt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 81f97dac8..a4e2b0131 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -1282,6 +1282,23 @@ krb5_get_init_creds(krb5_context context, ret = 0; cleanup: + if (ret != 0) { + char *client_name; + /* See if we can produce a more detailed error message. */ + switch (ret) { + case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN: + client_name = NULL; + if (krb5_unparse_name(context, client, &client_name) == 0) { + krb5_set_error_message(context, ret, + "Client '%s' not found in Kerberos database", + client_name); + free(client_name); + } + break; + default: + break; + } + } krb5_preauth_request_context_fini(context); if (encoded_previous_request != NULL) { krb5_free_data(context, encoded_previous_request); -- 2.26.2