diff options
author | Günther Deschner <gd@samba.org> | 2008-02-11 10:33:31 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-11 10:49:30 +0100 |
commit | 976fba87eb76649d62aaa335d15338ac151de0e0 (patch) | |
tree | 70cae42c6f68e370ecd55c5967a3b4b03ca13996 | |
parent | e1bd9c30b0eb442b3ccd178bd488d9e75679acfb (diff) | |
download | samba-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)
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 27 | ||||
-rw-r--r-- | source3/utils/net_rpc_rights.c | 23 |
2 files changed, 27 insertions, 23 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index e5d131e9c1..5d42cff738 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -439,13 +439,10 @@ static NTSTATUS cmd_lsa_enum_privilege(struct rpc_pipe_client *cli, { POLICY_HND pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; + struct lsa_PrivArray priv_array; uint32 enum_context=0; uint32 pref_max_length=0x1000; - uint32 count=0; - char **privs_name; - uint32 *privs_high; - uint32 *privs_low; int i; if (argc > 3) { @@ -466,18 +463,24 @@ static NTSTATUS cmd_lsa_enum_privilege(struct rpc_pipe_client *cli, if (!NT_STATUS_IS_OK(result)) goto done; - result = rpccli_lsa_enum_privilege(cli, mem_ctx, &pol, &enum_context, pref_max_length, - &count, &privs_name, &privs_high, &privs_low); - + result = rpccli_lsa_EnumPrivs(cli, mem_ctx, + &pol, + &enum_context, + &priv_array, + pref_max_length); if (!NT_STATUS_IS_OK(result)) goto done; /* Print results */ - printf("found %d privileges\n\n", count); - - for (i = 0; i < count; i++) { - printf("%s \t\t%d:%d (0x%x:0x%x)\n", privs_name[i] ? privs_name[i] : "*unknown*", - privs_high[i], privs_low[i], privs_high[i], privs_low[i]); + printf("found %d privileges\n\n", priv_array.count); + + for (i = 0; i < priv_array.count; i++) { + printf("%s \t\t%d:%d (0x%x:0x%x)\n", + priv_array.privs[i].name.string ? priv_array.privs[i].name.string : "*unknown*", + priv_array.privs[i].luid.high, + priv_array.privs[i].luid.low, + priv_array.privs[i].luid.high, + priv_array.privs[i].luid.low); } rpccli_lsa_Close(cli, mem_ctx, &pol); 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; |