summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-26 06:52:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:20 -0500
commit0aa89db9471330fd02db395c2eb387ac2dfef54f (patch)
treec4cf899e4aeb15bc926c2e4e470ee32f14b2bba4 /source3/rpc_client
parent404fa5636ddae8caa0a46bb68b796d23ec3f5a0e (diff)
downloadsamba-0aa89db9471330fd02db395c2eb387ac2dfef54f.tar.gz
samba-0aa89db9471330fd02db395c2eb387ac2dfef54f.tar.bz2
samba-0aa89db9471330fd02db395c2eb387ac2dfef54f.zip
r6071: * clean up UNISTR2_ARRAY ( really just an array of UNISTR4 + count )
* add some backwards compatibility to 'net rpc rights list' * verify privilege name in 'net rpc rights privileges <name>' in order to give back better error messages. (This used to be commit 0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c17
-rw-r--r--source3/rpc_client/cli_svcctl.c4
2 files changed, 13 insertions, 8 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 45b7509d45..81d535e54c 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -1260,12 +1260,16 @@ NTSTATUS cli_lsa_enum_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx,
}
- privileges = TALLOC_ARRAY(mem_ctx, fstring, *count);
- names = TALLOC_ARRAY(mem_ctx, char *, *count);
+ privileges = TALLOC_ARRAY( mem_ctx, fstring, *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);
+ UNISTR4 *uni_string = &r.rights->strings[i];
+
+ if ( !uni_string->string )
+ continue;
+
+ rpcstr_pull( privileges[i], uni_string->string->buffer, sizeof(privileges[i]), -1, STR_TERMINATE );
/* now copy to the return array */
names[i] = talloc_strdup( mem_ctx, privileges[i] );
@@ -1284,7 +1288,8 @@ done:
NTSTATUS cli_lsa_add_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx,
POLICY_HND *pol, DOM_SID sid,
- uint32 count, const char **privs_name)
+
+uint32 count, const char **privs_name)
{
prs_struct qbuf, rbuf;
LSA_Q_ADD_ACCT_RIGHTS q;
diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c
index 19bf419983..9f80bb79a3 100644
--- a/source3/rpc_client/cli_svcctl.c
+++ b/source3/rpc_client/cli_svcctl.c
@@ -323,8 +323,8 @@ WERROR cli_svcctl_start_service( struct cli_state *cli, TALLOC_CTX *mem_ctx,
memcpy( &in.handle, hService, sizeof(POLICY_HND) );
- in.parmcount = 0;
- in.parameters.ref_id = 0x0;
+ in.parmcount = 0;
+ in.parameters = NULL;
CLI_DO_RPC( cli, mem_ctx, PI_SVCCTL, SVCCTL_START_SERVICE_W,
in, out,