diff options
author | Robbie Harwood <rharwood@redhat.com> | 2018-04-27 13:51:39 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2018-05-02 00:54:53 -0400 |
commit | d48ad916d94c073aa9f208c2269e9da4a4a9a379 (patch) | |
tree | 86c68ead7bf9f928dd1209470a91043a70c1b9a1 | |
parent | fa945612c78e667771fecfc1b29e8a005c14c02c (diff) | |
download | krb5-d48ad916d94c073aa9f208c2269e9da4a4a9a379.zip krb5-d48ad916d94c073aa9f208c2269e9da4a4a9a379.tar.gz krb5-d48ad916d94c073aa9f208c2269e9da4a4a9a379.tar.bz2 |
Set error message on KCM get_princ failure
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
-rw-r--r-- | src/lib/krb5/ccache/cc_kcm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/krb5/ccache/cc_kcm.c b/src/lib/krb5/ccache/cc_kcm.c index a3afd70..b56363b 100644 --- a/src/lib/krb5/ccache/cc_kcm.c +++ b/src/lib/krb5/ccache/cc_kcm.c @@ -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); |