diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-01-28 21:31:45 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-01-28 21:31:45 +0000 |
commit | 79b26867c0ff712e9400f06fdb0a65bcb5e668b7 (patch) | |
tree | 9a5cf66cb51cf255321d3e3d419bfe1d1552d4b1 /source3/rpc_client | |
parent | 4571637a4bdd0d63367186f5612e49934fe568f6 (diff) | |
download | samba-79b26867c0ff712e9400f06fdb0a65bcb5e668b7.tar.gz samba-79b26867c0ff712e9400f06fdb0a65bcb5e668b7.tar.bz2 samba-79b26867c0ff712e9400f06fdb0a65bcb5e668b7.zip |
added LsaRemoveAccountRights
this now gives us complete remove privileges control in the client
libs, so we are in good shape for starting on the server side.
(This used to be commit bf99440398db86f46233eb2f5adddffb61280a1b)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 625e06f3ba..84b5aa725a 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -1250,6 +1250,48 @@ done: } +/* remove account rights for an account. */ + +NTSTATUS cli_lsa_remove_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *pol, DOM_SID sid, BOOL removeall, + uint32 count, const char **privs_name) +{ + prs_struct qbuf, rbuf; + LSA_Q_REMOVE_ACCT_RIGHTS q; + LSA_R_REMOVE_ACCT_RIGHTS r; + NTSTATUS result; + + ZERO_STRUCT(q); + + /* Initialise parse structures */ + prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); + prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); + + /* Marshall data and send request */ + init_q_remove_acct_rights(&q, pol, &sid, removeall?1:0, count, privs_name); + + if (!lsa_io_q_remove_acct_rights("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, LSA_REMOVEACCTRIGHTS, &qbuf, &rbuf)) { + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + /* Unmarshall response */ + + if (!lsa_io_r_remove_acct_rights("", &r, &rbuf, 0)) { + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + if (!NT_STATUS_IS_OK(result = r.status)) { + goto done; + } +done: + + return result; +} + + #if 0 /** An example of how to use the routines in this file. Fetch a DOMAIN |