diff options
author | Simo Sorce <idra@samba.org> | 2010-01-28 00:08:36 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-01-28 19:33:34 -0500 |
commit | c6865af4450432bec3f5383d6c815934ac89d434 (patch) | |
tree | c6c811678a06090d1ecb39aba4405d8445a4d1fc /source4/kdc/kdc.c | |
parent | f387ed88e8b5b32eb121724d99d73d8ce55e745e (diff) | |
download | samba-c6865af4450432bec3f5383d6c815934ac89d434.tar.gz samba-c6865af4450432bec3f5383d6c815934ac89d434.tar.xz samba-c6865af4450432bec3f5383d6c815934ac89d434.zip |
s4:kdc Use better db context structure
This allows to use a common structure not tied to hdb_samba4
Also allows to avoid many casts within hdb_samba4 functions
This is the first step to abstract samba kdc databse functions
so they can be used by the MIT forthcoming plugin.
Diffstat (limited to 'source4/kdc/kdc.c')
-rw-r--r-- | source4/kdc/kdc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index 86d03822ac..cddf7f0961 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -740,24 +740,24 @@ static void kdc_task_init(struct task_server *task) } kdc->config->num_db = 1; - status = hdb_samba4_create_kdc(kdc, task->event_ctx, task->lp_ctx, - kdc->smb_krb5_context->krb5_context, - &kdc->config->db[0]); - if (!NT_STATUS_IS_OK(status)) { - task_server_terminate(task, "kdc: hdb_samba4_create_kdc (setup KDC database) failed", true); - return; - } - /* Register hdb-samba4 hooks for use as a keytab */ - kdc->hdb_samba4_context = talloc(kdc, struct hdb_samba4_context); - if (!kdc->hdb_samba4_context) { + kdc->base_ctx = talloc_zero(kdc, struct samba_kdc_base_context); + if (!kdc->base_ctx) { task_server_terminate(task, "kdc: out of memory", true); return; } - kdc->hdb_samba4_context->ev_ctx = task->event_ctx; - kdc->hdb_samba4_context->lp_ctx = task->lp_ctx; + kdc->base_ctx->ev_ctx = task->event_ctx; + kdc->base_ctx->lp_ctx = task->lp_ctx; + + status = hdb_samba4_create_kdc(kdc->base_ctx, + kdc->smb_krb5_context->krb5_context, + &kdc->config->db[0]); + if (!NT_STATUS_IS_OK(status)) { + task_server_terminate(task, "kdc: hdb_samba4_create_kdc (setup KDC database) failed", true); + return; + } ret = krb5_plugin_register(kdc->smb_krb5_context->krb5_context, PLUGIN_TYPE_DATA, "hdb", |