diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-01-28 12:52:51 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-01-28 12:52:51 +0000 |
commit | 2e5e659e095a94b0716d97f673f993f0af99aabe (patch) | |
tree | c7a2ee058cd8516da21da5a14d0a4ddafe65938f /source/rpc_client | |
parent | 7cbb194b58a4313497541c1f8153533c5034b928 (diff) | |
download | samba-2e5e659e095a94b0716d97f673f993f0af99aabe.tar.gz samba-2e5e659e095a94b0716d97f673f993f0af99aabe.tar.xz samba-2e5e659e095a94b0716d97f673f993f0af99aabe.zip |
cleaned up the lsa_enum_acct_rights function and added a
lsa_add_acct_rights function.
This allows us to add privileges remotely to accounts using rpcclient.
Diffstat (limited to 'source/rpc_client')
-rw-r--r-- | source/rpc_client/cli_lsarpc.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c index 2b65c67f156..625e06f3ba5 100644 --- a/source/rpc_client/cli_lsarpc.c +++ b/source/rpc_client/cli_lsarpc.c @@ -1207,6 +1207,49 @@ done: } + +/* add account rights to an account. */ + +NTSTATUS cli_lsa_add_account_rights(struct cli_state *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *pol, DOM_SID sid, + uint32 count, const char **privs_name) +{ + prs_struct qbuf, rbuf; + LSA_Q_ADD_ACCT_RIGHTS q; + LSA_R_ADD_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_add_acct_rights(&q, pol, &sid, count, privs_name); + + if (!lsa_io_q_add_acct_rights("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, LSA_ADDACCTRIGHTS, &qbuf, &rbuf)) { + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + /* Unmarshall response */ + + if (!lsa_io_r_add_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 |