s4:rpc_server/lsa: pass the correct variable to setInfoTrustedDomain_base()
authorStefan Metzmacher <metze@samba.org>
Mon, 15 Dec 2014 15:03:49 +0000 (16:03 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 19 Dec 2014 12:15:13 +0000 (13:15 +0100)
This requires 'struct lsa_policy_state', we now pass this directly
instead of a instead of an opaque 'struct dcesrv_handle'.

dcesrv_lsa_SetInformationTrustedDomain() passes in a 'struct dcesrv_handle'
with 'struct lsa_trusted_domain_state' before, which results in segfaults.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source4/rpc_server/lsa/dcesrv_lsa.c

index 6c09649aaa2fd2917b496aee8fcb0e1b0c4df55a..40867dd4da0e3871b208d538022485c3bae65919 100644 (file)
@@ -1600,13 +1600,12 @@ static NTSTATUS update_trust_user(TALLOC_CTX *mem_ctx,
 
 
 static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call,
-                                         struct dcesrv_handle *p_handle,
+                                         struct lsa_policy_state *p_state,
                                          TALLOC_CTX *mem_ctx,
                                          struct ldb_message *dom_msg,
                                          enum lsa_TrustDomInfoEnum level,
                                          union lsa_TrustedDomainInfo *info)
 {
-       struct lsa_policy_state *p_state = p_handle->data;
        uint32_t *posix_offset = NULL;
        struct lsa_TrustDomainInfoInfoEx *info_ex = NULL;
        struct lsa_TrustDomainInfoAuthInfo *auth_info = NULL;
@@ -1942,7 +1941,7 @@ static NTSTATUS dcesrv_lsa_SetInformationTrustedDomain(
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
 
-       return setInfoTrustedDomain_base(dce_call, h, mem_ctx,
+       return setInfoTrustedDomain_base(dce_call, td_state->policy, mem_ctx,
                                         msgs[0], r->in.level, r->in.info);
 }
 
@@ -2160,7 +2159,7 @@ static NTSTATUS dcesrv_lsa_SetTrustedDomainInfoByName(struct dcesrv_call_state *
                return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
 
-       return setInfoTrustedDomain_base(dce_call, policy_handle, mem_ctx,
+       return setInfoTrustedDomain_base(dce_call, policy_state, mem_ctx,
                                         msgs[0], r->in.level, r->in.info);
 }