diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-06-08 13:53:29 +1200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-07-24 11:42:02 +0200 |
commit | 997f50c66471071efb8e02d8efbe4bf5d932e7ee (patch) | |
tree | 6e57b115adbe0c0f9ce57fa4ba9c01a8653c9836 | |
parent | 42ba919c06c24c42ef123304de0c2ca8c689591a (diff) | |
download | samba-997f50c66471071efb8e02d8efbe4bf5d932e7ee.tar.gz |
s4:kdc: Remove kadmin mode from HDB plugin
It appears we no longer require it.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r-- | source4/kdc/hdb-samba4-plugin.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/source4/kdc/hdb-samba4-plugin.c b/source4/kdc/hdb-samba4-plugin.c index 6f76124995d..4b90a766f76 100644 --- a/source4/kdc/hdb-samba4-plugin.c +++ b/source4/kdc/hdb-samba4-plugin.c @@ -21,40 +21,20 @@ #include "includes.h" #include "kdc/kdc-glue.h" -#include "kdc/db-glue.h" -#include "lib/util/samba_util.h" #include "lib/param/param.h" -#include "source4/lib/events/events.h" static krb5_error_code hdb_samba4_create(krb5_context context, struct HDB **db, const char *arg) { NTSTATUS nt_status; - void *ptr; - struct samba_kdc_base_context *base_ctx; - - if (sscanf(arg, "&%p", &ptr) == 1) { - base_ctx = talloc_get_type_abort(ptr, struct samba_kdc_base_context); - } else if (arg[0] == '\0' || file_exist(arg)) { - /* This mode for use in kadmin, rather than in Samba */ - - setup_logging("hdb_samba4", DEBUG_DEFAULT_STDERR); - - base_ctx = talloc_zero(NULL, struct samba_kdc_base_context); - if (!base_ctx) { - return ENOMEM; - } - - base_ctx->ev_ctx = s4_event_context_init(base_ctx); - base_ctx->lp_ctx = loadparm_init_global(false); - if (arg[0]) { - lpcfg_load(base_ctx->lp_ctx, arg); - } else { - lpcfg_load_default(base_ctx->lp_ctx); - } - } else { + void *ptr = NULL; + struct samba_kdc_base_context *base_ctx = NULL; + + if (sscanf(arg, "&%p", &ptr) != 1) { return EINVAL; } + base_ctx = talloc_get_type_abort(ptr, struct samba_kdc_base_context); + /* The global kdc_mem_ctx and kdc_lp_ctx, Disgusting, ugly hack, but it means one less private hook */ nt_status = hdb_samba4_create_kdc(base_ctx, context, db); @@ -90,8 +70,7 @@ static void hdb_samba4_fini(void *ctx) /* Only used in the hdb-backed keytab code * for a keytab of 'samba4&<address>' or samba4, to find - * kpasswd's key in the main DB, and to - * copy all the keys into a file (libnet_keytab_export) + * kpasswd's key in the main DB * * The <address> is the string form of a pointer to a talloced struct hdb_samba_context */ |