diff --git a/lib/krb5/keytab.c b/lib/krb5/keytab.c index cdbcc8609..ba8c27c39 100644 --- a/lib/krb5/keytab.c +++ b/lib/krb5/keytab.c @@ -449,7 +449,7 @@ krb5_kt_get_full_name(krb5_context context, * even on errors. * * @param context a Keberos context. - * @param id keytab to get name for. + * @param id keytab to close. * * @return Return an error code or 0, see krb5_get_error_message(). * @@ -468,6 +468,29 @@ krb5_kt_close(krb5_context context, return ret; } +/** + * Destroy (remove) the keytab in `id'. All resources will be released, + * even on errors, does the equvalment of krb5_kt_close() on the resources. + * + * @param context a Keberos context. + * @param id keytab to destroy. + * + * @return Return an error code or 0, see krb5_get_error_message(). + * + * @ingroup krb5_keytab + */ + +krb5_error_code KRB5_LIB_FUNCTION +krb5_kt_destroy(krb5_context context, + krb5_keytab id) +{ + krb5_error_code ret; + + ret = (*id->destroy)(context, id); + krb5_kt_close(context, id); + return ret; +} + /** * Compare `entry' against `principal, vno, enctype'. * Any of `principal, vno, enctype' might be 0 which acts as a wildcard.