From 2e6deee0208aba89fb3ecc7ead62d867e4da20ea Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 9 Jun 2007 00:13:07 +0000 Subject: r23400: Fix lsa crash bug #4683. The "names" enum struct in a lookup_sidX reply isn't optional - like the lookup_sidX query it needs to be defined in the struct. All this will go away with PIDL (thank goodness....). Jerry - I think this is a showstopper to be merged for 3.0.25b. I'll be watching the build farm to see if anything broke. Jeremy. (This used to be commit 9300b92f7a51eb80fdc039d8dad23ea9ce82aa8f) --- source3/rpc_client/cli_lsarpc.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index a6410b4954..ed70bc1752 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -145,7 +145,6 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, LSA_Q_LOOKUP_SIDS q; LSA_R_LOOKUP_SIDS r; DOM_R_REF ref; - LSA_TRANS_NAME_ENUM t_names; NTSTATUS result = NT_STATUS_OK; TALLOC_CTX *tmp_ctx = NULL; int i; @@ -163,10 +162,8 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, init_q_lookup_sids(tmp_ctx, &q, pol, num_sids, sids, 1); ZERO_STRUCT(ref); - ZERO_STRUCT(t_names); r.dom_ref = &ref; - r.names = &t_names; CLI_DO_RPC( cli, tmp_ctx, PI_LSARPC, LSA_LOOKUPSIDS, q, r, @@ -192,7 +189,7 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, for (i = 0; i < num_sids; i++) { fstring name, dom_name; - uint32 dom_idx = t_names.name[i].domain_idx; + uint32 dom_idx = r.names.name[i].domain_idx; /* Translate optimised name through domain index array */ @@ -201,14 +198,14 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, rpcstr_pull_unistr2_fstring( dom_name, &ref.ref_dom[dom_idx].uni_dom_name); rpcstr_pull_unistr2_fstring( - name, &t_names.uni_name[i]); + name, &r.names.uni_name[i]); (names)[i] = talloc_strdup(mem_ctx, name); (domains)[i] = talloc_strdup(mem_ctx, dom_name); - (types)[i] = (enum lsa_SidType)t_names.name[i].sid_name_use; + (types)[i] = (enum lsa_SidType)r.names.name[i].sid_name_use; if (((names)[i] == NULL) || ((domains)[i] == NULL)) { - DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); + DEBUG(0, ("cli_lsa_lookup_sids_noalloc(): out of memory\n")); result = NT_STATUS_UNSUCCESSFUL; goto done; } @@ -350,7 +347,6 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, LSA_Q_LOOKUP_SIDS q; LSA_R_LOOKUP_SIDS r; DOM_R_REF ref; - LSA_TRANS_NAME_ENUM t_names; NTSTATUS result = NT_STATUS_OK; int i; @@ -360,10 +356,8 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, init_q_lookup_sids(mem_ctx, &q, pol, num_sids, sids, 1); ZERO_STRUCT(ref); - ZERO_STRUCT(t_names); r.dom_ref = &ref; - r.names = &t_names; CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_LOOKUPSIDS, q, r, @@ -414,7 +408,7 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, for (i = 0; i < num_sids; i++) { fstring name, dom_name; - uint32 dom_idx = t_names.name[i].domain_idx; + uint32 dom_idx = r.names.name[i].domain_idx; /* Translate optimised name through domain index array */ @@ -423,11 +417,11 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, rpcstr_pull_unistr2_fstring( dom_name, &ref.ref_dom[dom_idx].uni_dom_name); rpcstr_pull_unistr2_fstring( - name, &t_names.uni_name[i]); + name, &r.names.uni_name[i]); (*names)[i] = talloc_strdup(mem_ctx, name); (*domains)[i] = talloc_strdup(mem_ctx, dom_name); - (*types)[i] = (enum lsa_SidType)t_names.name[i].sid_name_use; + (*types)[i] = (enum lsa_SidType)r.names.name[i].sid_name_use; if (((*names)[i] == NULL) || ((*domains)[i] == NULL)) { DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); -- cgit