]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Set error message on KCM get_princ failure
authorRobbie Harwood <rharwood@redhat.com>
Fri, 27 Apr 2018 17:51:39 +0000 (13:51 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 2 May 2018 04:54:53 +0000 (00:54 -0400)
This matches the expected behavior from other ccache types.  Most
notably, the KEYRING equivalent was added in
c25fc42e8eac7350209df61e4a7b9960d17755ca

(cherry picked from commit 58f60f3df7a625ccdcce23dfadd52dc335fd8da7)

ticket: 8675
version_fixed: 1.15.3

src/lib/krb5/ccache/cc_kcm.c

index a3afd7056bff3aa0cecf71ff3483fce8cab7b9ad..b56363ba9b9b86fca21b67b7e5cec1700b49043c 100644 (file)
@@ -721,12 +721,18 @@ kcm_get_princ(krb5_context context, krb5_ccache cache,
 {
     krb5_error_code ret;
     struct kcmreq req;
+    struct kcm_cache_data *data = cache->data;
 
     kcmreq_init(&req, KCM_OP_GET_PRINCIPAL, cache);
     ret = cache_call(context, cache, &req, FALSE);
     /* Heimdal KCM can respond with code 0 and no principal. */
     if (!ret && req.reply.len == 0)
         ret = KRB5_FCC_NOFILE;
+    if (ret == KRB5_FCC_NOFILE) {
+        k5_setmsg(context, ret, _("Credentials cache 'KCM:%s' not found"),
+                  data->residual);
+    }
+
     if (!ret)
         ret = k5_unmarshal_princ(req.reply.ptr, req.reply.len, 4, princ_out);
     kcmreq_free(&req);