]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use rpccli_lsa_RemoveAccountRights() in net and rpcclient.
authorGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 14:28:26 +0000 (15:28 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 14 Feb 2008 14:28:26 +0000 (15:28 +0100)
Guenther

source/rpcclient/cmd_lsarpc.c
source/utils/net_rpc_rights.c

index d7f5e55df4c8cb33e5374250cdc714b036ca4f88..3fe8bc8e52e4aeede83e85d522fafb9032d4bb08 100644 (file)
@@ -816,8 +816,9 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
 {
        POLICY_HND dom_pol;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
+       struct lsa_RightSet rights;
        DOM_SID sid;
+       int i;
 
        if (argc < 3 ) {
                printf("Usage: %s SID [rights...]\n", argv[0]);
@@ -835,8 +836,22 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
        if (!NT_STATUS_IS_OK(result))
                goto done;
 
-       result = rpccli_lsa_remove_account_rights(cli, mem_ctx, &dom_pol, sid, 
-                                              False, argc-2, argv+2);
+       rights.count = argc-2;
+       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+                                   rights.count);
+       if (!rights.names) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       for (i=0; i<argc-2; i++) {
+               init_lsa_StringLarge(&rights.names[i], argv[i+2]);
+       }
+
+       result = rpccli_lsa_RemoveAccountRights(cli, mem_ctx,
+                                               &dom_pol,
+                                               &sid,
+                                               false,
+                                               &rights);
 
        if (!NT_STATUS_IS_OK(result))
                goto done;
index a0df5d8980d4af93080f5510e0bf2b8e12a5c3c2..16d75e57d9cadf6cdcfd7dd519f7b702ab53e919 100644 (file)
@@ -502,8 +502,9 @@ static NTSTATUS rpc_rights_revoke_internal(const DOM_SID *domain_sid,
 {
        POLICY_HND dom_pol;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
+       struct lsa_RightSet rights;
        DOM_SID sid;
+       int i;
 
        if (argc < 2 ) {
                d_printf("Usage: net rpc rights revoke <name|SID> <rights...>\n");
@@ -521,8 +522,22 @@ static NTSTATUS rpc_rights_revoke_internal(const DOM_SID *domain_sid,
        if (!NT_STATUS_IS_OK(result))
                return result;  
 
-       result = rpccli_lsa_remove_account_rights(pipe_hnd, mem_ctx, &dom_pol, sid, 
-                                              False, argc-1, argv+1);
+       rights.count = argc-1;
+       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+                                   rights.count);
+       if (!rights.names) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       for (i=0; i<argc-1; i++) {
+               init_lsa_StringLarge(&rights.names[i], argv[i+1]);
+       }
+
+       result = rpccli_lsa_RemoveAccountRights(pipe_hnd, mem_ctx,
+                                               &dom_pol,
+                                               &sid,
+                                               false,
+                                               &rights);
 
        if (!NT_STATUS_IS_OK(result))
                goto done;