summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-06-09 00:13:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:13 -0500
commit2e6deee0208aba89fb3ecc7ead62d867e4da20ea (patch)
treea04a2125eca2571cedbbfee9b2d608495d3b486c /source3/rpc_client
parentbde0642ab43b92b780bd60cc889116154110c878 (diff)
downloadsamba-2e6deee0208aba89fb3ecc7ead62d867e4da20ea.tar.gz
samba-2e6deee0208aba89fb3ecc7ead62d867e4da20ea.tar.bz2
samba-2e6deee0208aba89fb3ecc7ead62d867e4da20ea.zip
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)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c20
1 files changed, 7 insertions, 13 deletions
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"));