diff options
author | Günther Deschner <gd@samba.org> | 2008-02-14 15:09:21 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-14 15:09:21 +0100 |
commit | 7b5ef3569f081e29890594b533ee0062deec0b15 (patch) | |
tree | 45f1ef63c82f40dea53cceccd47e328afa67fa1a /source3/utils | |
parent | 235efc0ede0a4951f4f6c4714e1bfd123d0816bd (diff) | |
download | samba-7b5ef3569f081e29890594b533ee0062deec0b15.tar.gz samba-7b5ef3569f081e29890594b533ee0062deec0b15.tar.bz2 samba-7b5ef3569f081e29890594b533ee0062deec0b15.zip |
Use rpccli_lsa_EnumAccountRights in net and rpcclient.
Guenther
(This used to be commit 6e9195329d9f2b26c959f64485902c032f140ec8)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_rights.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index 9ba0eaae00..a0df5d8980 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -152,22 +152,24 @@ static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd, const char *right) { NTSTATUS result; - uint32 count; - char **rights; + struct lsa_RightSet rights; int i; - result = rpccli_lsa_enum_account_rights(pipe_hnd, ctx, pol, sid, &count, &rights); + result = rpccli_lsa_EnumAccountRights(pipe_hnd, ctx, + pol, + sid, + &rights); if (!NT_STATUS_IS_OK(result)) { return result; } - if (count == 0) { + if (rights.count == 0) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; } - - for (i = 0; i < count; i++) { - if (StrCaseCmp(rights[i], right) == 0) { + + for (i = 0; i < rights.count; i++) { + if (StrCaseCmp(rights.names[i].string, right) == 0) { return NT_STATUS_OK; } } @@ -184,20 +186,23 @@ static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd, DOM_SID *sid ) { NTSTATUS result; - uint32 count; - char **rights; + struct lsa_RightSet rights; int i; - result = rpccli_lsa_enum_account_rights(pipe_hnd, ctx, pol, sid, &count, &rights); + result = rpccli_lsa_EnumAccountRights(pipe_hnd, ctx, + pol, + sid, + &rights); if (!NT_STATUS_IS_OK(result)) return result; - if ( count == 0 ) + if (rights.count == 0) { d_printf("No privileges assigned\n"); - - for (i = 0; i < count; i++) { - printf("%s\n", rights[i]); + } + + for (i = 0; i < rights.count; i++) { + printf("%s\n", rights.names[i].string); } return NT_STATUS_OK; |