diff options
author | Gerald Carter <jerry@samba.org> | 2005-03-26 06:52:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:20 -0500 |
commit | 0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13 (patch) | |
tree | e95fceea8cdd7700f6b0b886bad1b077e0779d6a /source/rpc_client | |
parent | d6ad1f8df05e16152d9c95df56e612fde288d3b4 (diff) | |
download | samba-0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13.tar.gz samba-0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13.tar.xz samba-0e29dc8aa384dfa6d2495beb8a9ffb5371e60a13.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.
Diffstat (limited to 'source/rpc_client')
-rw-r--r-- | source/rpc_client/cli_lsarpc.c | 17 | ||||
-rw-r--r-- | source/rpc_client/cli_svcctl.c | 4 |
2 files changed, 13 insertions, 8 deletions
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c index 45b7509d451..81d535e54c0 100644 --- a/source/rpc_client/cli_lsarpc.c +++ b/source/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/source/rpc_client/cli_svcctl.c b/source/rpc_client/cli_svcctl.c index 19bf4199831..9f80bb79a39 100644 --- a/source/rpc_client/cli_svcctl.c +++ b/source/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, |