krb5/krb5 — pull request #211 by DirectXMan12 (2014-09-18 20:28:39+00:00)
Title: Make kg_impersonate_name check for NULL ccache

When making a call to gss_acquire_cred_impersonate_name
or gss_add_cred_impersonate_name using the krb5 mech,
the call kg_impersonate_name attempts to use the credentials
cache associated with the impersonator credentials. However,
if the impersonator credentials were acquired with a usage of
GSS_C_ACCEPT, then the ccache member of the cred struct will
be NULL. This will cause the call to segfault.

Instead, we now check in kg_impersonate_name to make sure that the
ccache member is not NULL. If it is, we return a major and minor
status of GSS_S_DEFECTIVE_CREDENTIAL and KG_CCACHE_NOMATCH
(respectively).