krb5 commit: Add krb5_db_register_keytab()
Greg Hudson
ghudson at mit.edu
Thu Sep 8 11:01:29 EDT 2016
https://github.com/krb5/krb5/commit/2e99582062d9d6a70f2adb00fd8fe58a1f95b9b7
commit 2e99582062d9d6a70f2adb00fd8fe58a1f95b9b7
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 7 18:33:43 2016 +0200
Add krb5_db_register_keytab()
Add a public libkdb5 function to register the KDB keytab type. This
functionality is needed for out-of-tree KDC servers such as the Samba
kpasswd service.
[ghudson at mit.edu: edited comments, whitespace, commit message]
ticket: 8494 (new)
src/include/kdb.h | 7 +++++++
src/lib/kdb/keytab.c | 6 ++++++
src/lib/kdb/libkdb5.exports | 1 +
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/include/kdb.h b/src/include/kdb.h
index c6dd15f..e9d1a84 100644
--- a/src/include/kdb.h
+++ b/src/include/kdb.h
@@ -837,6 +837,13 @@ krb5_dbe_free_strings(krb5_context, krb5_string_attr *, int count);
void
krb5_dbe_free_string(krb5_context, char *);
+/*
+ * Register the KDB keytab type, allowing "KDB:" to be used as a keytab name.
+ * For this type to work, the context used for keytab operations must have an
+ * associated database handle (via krb5_db_open()).
+ */
+krb5_error_code krb5_db_register_keytab(krb5_context context);
+
#define KRB5_KDB_DEF_FLAGS 0
#define KDB_MAX_DB_NAME 128
diff --git a/src/lib/kdb/keytab.c b/src/lib/kdb/keytab.c
index b85b67d..c6aa100 100644
--- a/src/lib/kdb/keytab.c
+++ b/src/lib/kdb/keytab.c
@@ -66,6 +66,12 @@ typedef struct krb5_ktkdb_data {
} krb5_ktkdb_data;
krb5_error_code
+krb5_db_register_keytab(krb5_context context)
+{
+ return krb5_kt_register(context, &krb5_kt_kdb_ops);
+}
+
+krb5_error_code
krb5_ktkdb_resolve(context, name, id)
krb5_context context;
const char * name;
diff --git a/src/lib/kdb/libkdb5.exports b/src/lib/kdb/libkdb5.exports
index f7b3061..5df596a 100644
--- a/src/lib/kdb/libkdb5.exports
+++ b/src/lib/kdb/libkdb5.exports
@@ -87,6 +87,7 @@ krb5_db_delete_policy
krb5_db_free_policy
krb5_def_store_mkey_list
krb5_db_promote
+krb5_db_register_keytab
ulog_add_update
ulog_init_header
ulog_map
More information about the cvs-krb5
mailing list