mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:libads: don't allow ads_kdestroy(NULL) anymore
This should not happen, if we ever need that behaviour we should add an ads_kdestroy_default() helper. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
4959f93227
commit
e47f9415b7
@ -284,23 +284,25 @@ int ads_kdestroy(const char *cc_name)
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cc_name) {
|
/*
|
||||||
if ((code = krb5_cc_default(ctx, &cc))) {
|
* This should not happen, if
|
||||||
krb5_free_context(ctx);
|
* we need that behaviour we
|
||||||
return code;
|
* should add an ads_kdestroy_default()
|
||||||
}
|
*/
|
||||||
} else {
|
SMB_ASSERT(cc_name != NULL);
|
||||||
if ((code = krb5_cc_resolve(ctx, cc_name, &cc))) {
|
|
||||||
DEBUG(3, ("ads_kdestroy: krb5_cc_resolve failed: %s\n",
|
code = krb5_cc_resolve(ctx, cc_name, &cc);
|
||||||
error_message(code)));
|
if (code != 0) {
|
||||||
krb5_free_context(ctx);
|
DBG_NOTICE("krb5_cc_resolve(%s) failed: %s\n",
|
||||||
return code;
|
cc_name, error_message(code));
|
||||||
}
|
krb5_free_context(ctx);
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((code = krb5_cc_destroy (ctx, cc))) {
|
code = krb5_cc_destroy(ctx, cc);
|
||||||
DEBUG(3, ("ads_kdestroy: krb5_cc_destroy failed: %s\n",
|
if (code != 0) {
|
||||||
error_message(code)));
|
DBG_ERR("krb5_cc_destroy(%s) failed: %s\n",
|
||||||
|
cc_name, error_message(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_free_context (ctx);
|
krb5_free_context (ctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user