summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-11 10:33:31 +0100
committerGünther Deschner <gd@samba.org>2008-02-11 10:49:30 +0100
commit976fba87eb76649d62aaa335d15338ac151de0e0 (patch)
tree70cae42c6f68e370ecd55c5967a3b4b03ca13996 /source3/utils
parente1bd9c30b0eb442b3ccd178bd488d9e75679acfb (diff)
downloadsamba-976fba87eb76649d62aaa335d15338ac151de0e0.tar.gz
samba-976fba87eb76649d62aaa335d15338ac151de0e0.tar.bz2
samba-976fba87eb76649d62aaa335d15338ac151de0e0.zip
Use rpccli_lsa_EnumPrivs() in net and rpcclient.
Guenther (This used to be commit bb24cccfc87dd8b97cc68a0dd205dc338f21f37d)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_rights.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
index 5f222b8c7e..afa786f0f5 100644
--- a/source3/utils/net_rpc_rights.c
+++ b/source3/utils/net_rpc_rights.c
@@ -94,31 +94,32 @@ static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd,
NTSTATUS result;
uint32 enum_context = 0;
uint32 pref_max_length=0x1000;
- uint32 count=0;
- char **privs_name;
- uint32 *privs_high;
- uint32 *privs_low;
int i;
uint16 lang_id=0;
uint16 lang_id_sys=0;
uint16 lang_id_desc;
fstring description;
+ struct lsa_PrivArray priv_array;
- result = rpccli_lsa_enum_privilege(pipe_hnd, ctx, pol, &enum_context,
- pref_max_length, &count, &privs_name, &privs_high, &privs_low);
+ result = rpccli_lsa_EnumPrivs(pipe_hnd, ctx,
+ pol,
+ &enum_context,
+ &priv_array,
+ pref_max_length);
if ( !NT_STATUS_IS_OK(result) )
return result;
/* Print results */
-
- for (i = 0; i < count; i++) {
- d_printf("%30s ", privs_name[i] ? privs_name[i] : "*unknown*" );
-
+
+ for (i = 0; i < priv_array.count; i++) {
+ d_printf("%30s ",
+ priv_array.privs[i].name.string ? priv_array.privs[i].name.string : "*unknown*" );
+
/* try to get the description */
if ( !NT_STATUS_IS_OK(rpccli_lsa_get_dispname(pipe_hnd, ctx, pol,
- privs_name[i], lang_id, lang_id_sys, description, &lang_id_desc)) )
+ priv_array.privs[i].name.string, lang_id, lang_id_sys, description, &lang_id_desc)) )
{
d_printf("??????\n");
continue;