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

ticket: 8675 (new)
tags: pullup
target_version: 1.16-next
target_version: 1.15-next

src/lib/krb5/ccache/cc_kcm.c

index 0d38b1839e73e6a970f7842e479931791ec45412..a777f2710b5b27deb7c28a4bb02ef9a7f351d91f 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);