krb5 commit: Add ulog_fini()
Greg Hudson
ghudson at mit.edu
Wed Aug 10 20:49:25 EDT 2016
https://github.com/krb5/krb5/commit/eb24cc9ca32998eb370ffd6c93dcf7d62c770e5a
commit eb24cc9ca32998eb370ffd6c93dcf7d62c770e5a
Author: Greg Hudson <ghudson at mit.edu>
Date: Wed Jun 29 17:12:47 2016 -0400
Add ulog_fini()
Add a function to unmap and free the iprop logging resources attached
to a krb5_context.
src/include/kdb_log.h | 1 +
src/lib/kdb/kdb_log.c | 13 +++++++++++++
src/lib/kdb/libkdb5.exports | 1 +
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/include/kdb_log.h b/src/include/kdb_log.h
index bb0847c..25b8236 100644
--- a/src/include/kdb_log.h
+++ b/src/include/kdb_log.h
@@ -77,6 +77,7 @@ update_status_t ulog_get_sno_status(krb5_context context,
const kdb_last_t *last);
krb5_error_code ulog_get_last(krb5_context context, kdb_last_t *last_out);
krb5_error_code ulog_set_last(krb5_context context, const kdb_last_t *last);
+void ulog_fini(krb5_context context);
typedef struct kdb_hlog {
uint32_t kdb_hmagic; /* Log header magic # */
diff --git a/src/lib/kdb/kdb_log.c b/src/lib/kdb/kdb_log.c
index 99cda59..766d300 100644
--- a/src/lib/kdb/kdb_log.c
+++ b/src/lib/kdb/kdb_log.c
@@ -672,3 +672,16 @@ ulog_set_last(krb5_context context, const kdb_last_t *last)
unlock_ulog(context);
return 0;
}
+
+void
+ulog_fini(krb5_context context)
+{
+ kdb_log_context *log_ctx = context->kdblog_context;
+
+ if (log_ctx == NULL)
+ return;
+ if (log_ctx->ulog != NULL)
+ munmap(log_ctx->ulog, MAXLOGLEN);
+ free(log_ctx);
+ context->kdblog_context = NULL;
+}
diff --git a/src/lib/kdb/libkdb5.exports b/src/lib/kdb/libkdb5.exports
index 130f8d8..f7b3061 100644
--- a/src/lib/kdb/libkdb5.exports
+++ b/src/lib/kdb/libkdb5.exports
@@ -95,6 +95,7 @@ ulog_free_entries
xdr_kdb_last_t
xdr_kdb_incr_result_t
xdr_kdb_fullresync_result_t
+ulog_fini
ulog_get_entries
ulog_get_last
ulog_get_sno_status
More information about the cvs-krb5
mailing list