diff options
author | Jeremy Allison <jra@samba.org> | 2003-01-28 21:09:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-01-28 21:09:56 +0000 |
commit | 734c6d8a513272c6e65ba60c62e21080c4339b8d (patch) | |
tree | eb4008ba0d684b2bf8aaf8b2f01106dbd7878737 /source3/rpc_client | |
parent | 3a9dfe6384329d2039a32be44127ac121e75533f (diff) | |
download | samba-734c6d8a513272c6e65ba60c62e21080c4339b8d.tar.gz samba-734c6d8a513272c6e65ba60c62e21080c4339b8d.tar.bz2 samba-734c6d8a513272c6e65ba60c62e21080c4339b8d.zip |
Merging tridge's privillage client changes from HEAD.
Jeremy.
(This used to be commit 30a33920b4d834edc877cc0080291fbda983083a)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 2b65c67f15..d9d05299cb 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -1206,6 +1206,46 @@ done: return result; } +/* 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 |