From b3757eadf05a4e47a5cd19049ee2c5eecf140c37 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 19 Jan 2005 16:52:19 +0000 Subject: r4849: * finish SeAddUsers support in srv_samr_nt.c * define some const SE_PRIV structure for use when you need a SE_PRIV* to a privilege * fix an annoying compiler warngin in smbfilter.c * translate SIDs to names in 'net rpc rights list accounts' * fix a seg fault in cli_lsa_enum_account_rights caused by me forgetting the precedence of * vs. [] (This used to be commit d25fc84bc2b14da9fcc0f3c8d7baeca83f0ea708) --- source3/rpc_client/cli_lsarpc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index bf2c0353c0..98c2475a65 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -1218,7 +1218,7 @@ NTSTATUS cli_lsa_query_secobj(struct cli_state *cli, TALLOC_CTX *mem_ctx, NTSTATUS cli_lsa_enum_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx, POLICY_HND *pol, DOM_SID *sid, - uint32 *count, char ***privs_name) + uint32 *count, char ***priv_names) { prs_struct qbuf, rbuf; LSA_Q_ENUM_ACCT_RIGHTS q; @@ -1226,6 +1226,7 @@ NTSTATUS cli_lsa_enum_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx, NTSTATUS result; int i; fstring *privileges; + char **names; ZERO_STRUCT(q); ZERO_STRUCT(r); @@ -1260,15 +1261,17 @@ NTSTATUS cli_lsa_enum_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx, privileges = TALLOC_ARRAY(mem_ctx, fstring, *count); - *privs_name = TALLOC_ARRAY(mem_ctx, char *, *count); + names = TALLOC_ARRAY(mem_ctx, char *, *count); for ( i=0; i<*count; i++ ) { /* ensure NULL termination ... what a hack */ pull_ucs2(NULL, privileges[i], r.rights.strings[i].string.buffer, sizeof(fstring), r.rights.strings[i].string.uni_str_len*2 , 0); /* now copy to the return array */ - *privs_name[i] = talloc_strdup( mem_ctx, privileges[i] ); + names[i] = talloc_strdup( mem_ctx, privileges[i] ); } + + *priv_names = names; done: -- cgit