gss: Prefer the default ccache when user_realm
commit312f353b986f37b4868b826989841a1f981fe8d0
authorNicolas Williams <nico@twosigma.com>
Thu, 12 Mar 2020 22:58:53 +0000 (12 17:58 -0500)
committerNicolas Williams <nico@twosigma.com>
Fri, 13 Mar 2020 02:02:09 +0000 (12 21:02 -0500)
treedaa48295474f9ebcf1d2eea43f9c81dbf68e4dfe
parent02db43a1aede9cbafc7908333abf83680567aeca
gss: Prefer the default ccache when user_realm

gss_store_cred_into*() will now switch the new cred cache to be the
primary/default cred cache when

 - the caller requested it and,
 - if the caller passed in a user name, the creds' principal is the best
   principal for the named user.

A principal is the best principal for a user when the principal has just
one component, the component is the user's username, and the realm is
the configured user_realm.
lib/gssapi/krb5/store_cred.c