Skip to content

Commit

Permalink
Set error message on KCM get_princ failure
Browse files Browse the repository at this point in the history
This matches the expected behavior from other ccache types.  Most
notably, the KEYRING equivalent was added in
c25fc42

(cherry picked from commit 58f60f3)

ticket: 8675
version_fixed: 1.16.1
  • Loading branch information
frozencemetery authored and greghudson committed May 2, 2018
1 parent 6763232 commit 300d877
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/krb5/ccache/cc_kcm.c
Expand Up @@ -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);
Expand Down

0 comments on commit 300d877

Please sign in to comment.