summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/lib/krb5/db_plugin.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
commit4f5791ebd03eaec1c7da0865a383175b05102712 (patch)
tree8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/heimdal/lib/krb5/db_plugin.c
parentInitial commit. (diff)
downloadsamba-upstream.tar.xz
samba-upstream.zip
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/lib/krb5/db_plugin.c')
-rw-r--r--third_party/heimdal/lib/krb5/db_plugin.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/third_party/heimdal/lib/krb5/db_plugin.c b/third_party/heimdal/lib/krb5/db_plugin.c
new file mode 100644
index 0000000..2933bd8
--- /dev/null
+++ b/third_party/heimdal/lib/krb5/db_plugin.c
@@ -0,0 +1,41 @@
+/*
+ */
+
+#include "krb5_locl.h"
+#include "db_plugin.h"
+
+/* Default plugin (DB using binary search of sorted text file) follows */
+static heim_base_once_t db_plugins_once = HEIM_BASE_ONCE_INIT;
+
+static krb5_error_code KRB5_LIB_CALL
+db_plugins_plcallback(krb5_context context, const void *plug, void *plugctx,
+ void *userctx)
+{
+ return 0;
+}
+
+static const char *db_plugin_deps[] = { "krb5", NULL };
+
+static struct heim_plugin_data
+db_plugin_data = {
+ "krb5",
+ KRB5_PLUGIN_DB,
+ KRB5_PLUGIN_DB_VERSION_0,
+ db_plugin_deps,
+ krb5_get_instance
+};
+
+static void
+db_plugins_init(void *arg)
+{
+ krb5_context context = arg;
+ (void)_krb5_plugin_run_f(context, &db_plugin_data, 0, NULL,
+ db_plugins_plcallback);
+}
+
+KRB5_LIB_FUNCTION void KRB5_LIB_CALL
+_krb5_load_db_plugins(krb5_context context)
+{
+ heim_base_once_f(&db_plugins_once, context, db_plugins_init);
+}
+