From 5d4a556b1cb6a3e718b06f61793d3bcdad05b524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 25 Jan 2009 00:45:37 +0000 Subject: [PATCH] add krb5_kt_destroy git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24447 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/keytab.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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.