(_kadm5_c_get_cred_cache): handle ccache case better in case no client
name was passed in. Coverity, NetBSD CID#919 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17029 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -314,8 +314,13 @@ _kadm5_c_get_cred_cache(krb5_context context,
|
||||
id = NULL;
|
||||
}
|
||||
}
|
||||
} else if(ccache != NULL)
|
||||
} else if(ccache != NULL) {
|
||||
id = ccache;
|
||||
ret = krb5_cc_get_principal(context, id, &client);
|
||||
if(ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
if(id && (default_client == NULL ||
|
||||
krb5_principal_compare(context, client, default_client))) {
|
||||
@@ -332,7 +337,7 @@ _kadm5_c_get_cred_cache(krb5_context context,
|
||||
return -1;
|
||||
}
|
||||
/* get creds via AS request */
|
||||
if(id)
|
||||
if(id && (id != ccache))
|
||||
krb5_cc_close(context, id);
|
||||
if (client != default_client)
|
||||
krb5_free_principal(context, default_client);
|
||||
|
Reference in New Issue
Block a user