summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpcclient/cmd_lsarpc.c27
-rw-r--r--source3/utils/net_rpc_rights.c23
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;