Ensure the hdb_method structure is not on the stack.
authorAndrew Bartlett <abartlet@samba.org>
Mon, 20 Oct 2008 03:21:21 +0000 (14:21 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 20 Oct 2008 09:07:09 +0000 (20:07 +1100)
We supply this to krb5 as a plugin, so we must keep it around as long
as the krb5_context.

Andrew Bartlett

source4/kdc/kdc.c

index cf6dbf0c93d0532b05369441897f9e2a78b3aa88..45fa803d0497765b89dbfd3561a11c8261aaec65 100644 (file)
@@ -657,6 +657,11 @@ static NTSTATUS kdc_check_generic_kerberos(struct irpc_message *msg,
 }
 
 
 }
 
 
+static struct hdb_method hdb_samba4 = {
+       .interface_version = HDB_INTERFACE_VERSION,
+       .prefix = "samba4:",
+       .create = hdb_samba4_create
+};
 
 /*
   startup the kdc task
 
 /*
   startup the kdc task
@@ -667,11 +672,6 @@ static void kdc_task_init(struct task_server *task)
        NTSTATUS status;
        krb5_error_code ret;
        struct interface *ifaces;
        NTSTATUS status;
        krb5_error_code ret;
        struct interface *ifaces;
-       struct hdb_method hdb_samba4 = {
-               .interface_version = HDB_INTERFACE_VERSION,
-               .prefix = "samba4:",
-               .create = hdb_samba4_create
-       };
 
        switch (lp_server_role(task->lp_ctx)) {
        case ROLE_STANDALONE:
 
        switch (lp_server_role(task->lp_ctx)) {
        case ROLE_STANDALONE: