summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-01-15 09:15:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:54 -0500
commitf2f08b64a53f6efd3154ff2656ecacc86872a18c (patch)
tree3d71d2c8622d9be1ddeea4da8f9b76d5d8aa13b2
parenta8aab6de7516b70cae6c096883874fa152777b13 (diff)
downloadsamba-f2f08b64a53f6efd3154ff2656ecacc86872a18c.tar.gz
samba-f2f08b64a53f6efd3154ff2656ecacc86872a18c.tar.xz
samba-f2f08b64a53f6efd3154ff2656ecacc86872a18c.zip
r4750: Fix cli_samr_queryuseraliases. There can be more than one sid, thus more than
one pointer... Volker
-rw-r--r--source/rpc_client/cli_samr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/rpc_client/cli_samr.c b/source/rpc_client/cli_samr.c
index 6b6a68059c2..bec94ce7a57 100644
--- a/source/rpc_client/cli_samr.c
+++ b/source/rpc_client/cli_samr.c
@@ -698,7 +698,8 @@ NTSTATUS cli_samr_query_useraliases(struct cli_state *cli, TALLOC_CTX *mem_ctx,
SAMR_Q_QUERY_USERALIASES q;
SAMR_R_QUERY_USERALIASES r;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- unsigned int ptr=1;
+ int i;
+ uint32 *sid_ptrs;
DEBUG(10,("cli_samr_query_useraliases\n"));
@@ -710,9 +711,16 @@ NTSTATUS cli_samr_query_useraliases(struct cli_state *cli, TALLOC_CTX *mem_ctx,
prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
prs_init(&rbuf, 0, mem_ctx, UNMARSHALL);
+ sid_ptrs = TALLOC_ARRAY(mem_ctx, uint32, num_sids);
+ if (sid_ptrs == NULL)
+ return NT_STATUS_NO_MEMORY;
+
+ for (i=0; i<num_sids; i++)
+ sid_ptrs[i] = 1;
+
/* Marshall data and send request */
- init_samr_q_query_useraliases(&q, user_pol, num_sids, &ptr, sid);
+ init_samr_q_query_useraliases(&q, user_pol, num_sids, sid_ptrs, sid);
if (!samr_io_q_query_useraliases("", &q, &qbuf, 0) ||
!rpc_api_pipe_req(cli, PI_SAMR, SAMR_QUERY_USERALIASES, &qbuf, &rbuf))