diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-07-27 13:48:45 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-07-27 22:41:41 +1000 |
commit | afb6ac247be9fa2e5e34dcf69e6b5ba557e19892 (patch) | |
tree | 7f83eb9b821e9d852c6c0ce948827089c25014ed /source4/kdc/kdc.c | |
parent | 34c535c9a8d08a480e156aaa9e4b843ffaab0636 (diff) | |
download | samba-afb6ac247be9fa2e5e34dcf69e6b5ba557e19892.tar.gz samba-afb6ac247be9fa2e5e34dcf69e6b5ba557e19892.tar.bz2 samba-afb6ac247be9fa2e5e34dcf69e6b5ba557e19892.zip |
s4:kdc Tidy up hdb_samba4 some more
This removes the last use of the prefix hdb_ldb and makes it clear
that we pass in 3 global variables to get state information into
hdb_samba4 when used as a keytab. (And that they belong to
hdb_samba4, not to the KDC)
Andrew Bartlett
Diffstat (limited to 'source4/kdc/kdc.c')
-rw-r--r-- | source4/kdc/kdc.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index ad74e10227..28d8da9d9f 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -43,9 +43,9 @@ /* Disgusting hack to get a mem_ctx and lp_ctx into the hdb plugin, when * used as a keytab */ -TALLOC_CTX *kdc_mem_ctx; -struct tevent_context *kdc_ev_ctx; -struct loadparm_context *kdc_lp_ctx; +TALLOC_CTX *hdb_samba4_mem_ctx; +struct tevent_context *hdb_samba4_ev_ctx; +struct loadparm_context *hdb_samba4_lp_ctx; /* hold all the info needed to send a reply */ struct kdc_reply { @@ -659,14 +659,6 @@ static NTSTATUS kdc_check_generic_kerberos(struct irpc_message *msg, } -static struct hdb_method hdb_samba4 = { - .interface_version = HDB_INTERFACE_VERSION, - .prefix = "samba4", /* Only used in the hdb-backed keytab code - * for a keytab of 'samba4:', to find - * kpasswd's key in the main DB */ - .create = hdb_samba4_create -}; - /* startup the kdc task */ @@ -733,16 +725,20 @@ static void kdc_task_init(struct task_server *task) } kdc->config->num_db = 1; - status = kdc_hdb_samba4_create(kdc, task->event_ctx, task->lp_ctx, - kdc->smb_krb5_context->krb5_context, - &kdc->config->db[0], NULL); + 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_ldb_create (setup KDC database) failed"); return; } - /* Register hdb-samba4 hooks */ + + hdb_samba4_mem_ctx = kdc->smb_krb5_context; + hdb_samba4_ev_ctx = task->event_ctx; + hdb_samba4_lp_ctx = task->lp_ctx; + ret = krb5_plugin_register(kdc->smb_krb5_context->krb5_context, PLUGIN_TYPE_DATA, "hdb", &hdb_samba4); @@ -768,10 +764,6 @@ static void kdc_task_init(struct task_server *task) krb5_kdc_windc_init(kdc->smb_krb5_context->krb5_context); - kdc_mem_ctx = kdc->smb_krb5_context; - kdc_ev_ctx = task->event_ctx; - kdc_lp_ctx = task->lp_ctx; - /* start listening on the configured network interfaces */ status = kdc_startup_interfaces(kdc, task->lp_ctx, ifaces); if (!NT_STATUS_IS_OK(status)) { |