diff options
author | Jim McDonough <jmcd@samba.org> | 2005-02-28 10:55:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:55:49 -0500 |
commit | ac1cc8712295fafc007d1341e68b84cfb7b7b7a1 (patch) | |
tree | 4051ba2c2960aab1cd0f57ad9f287b895275b7ff /source3/rpc_client | |
parent | 2f158e1565e634958abf2efe31736c55d20f55cd (diff) | |
download | samba-ac1cc8712295fafc007d1341e68b84cfb7b7b7a1.tar.gz samba-ac1cc8712295fafc007d1341e68b84cfb7b7b7a1.tar.bz2 samba-ac1cc8712295fafc007d1341e68b84cfb7b7b7a1.zip |
r5591: Implement "net rpc trustdom del", including client side of
samr_remove_sid_from_foreign_domain.
(This used to be commit 8360695fc02dfb09aff92a434bf9d411e65c478c)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_samr.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index 5473168c0f..75751dbcbd 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -2051,6 +2051,54 @@ NTSTATUS cli_samr_delete_dom_user(struct cli_state *cli, TALLOC_CTX *mem_ctx, return result; } +/* Remove foreign SID */ + +NTSTATUS cli_samr_remove_sid_foreign_domain(struct cli_state *cli, + TALLOC_CTX *mem_ctx, + POLICY_HND *user_pol, + DOM_SID *sid) +{ + prs_struct qbuf, rbuf; + SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN q; + SAMR_R_REMOVE_SID_FOREIGN_DOMAIN r; + NTSTATUS result = NT_STATUS_UNSUCCESSFUL; + + DEBUG(10,("cli_samr_remove_sid_foreign_domain\n")); + + ZERO_STRUCT(q); + ZERO_STRUCT(r); + + /* 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_samr_q_remove_sid_foreign_domain(&q, user_pol, sid); + + if (!samr_io_q_remove_sid_foreign_domain("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, PI_SAMR, SAMR_REMOVE_SID_FOREIGN_DOMAIN, &qbuf, &rbuf)) { + goto done; + } + + /* Unmarshall response */ + + if (!samr_io_r_remove_sid_foreign_domain("", &r, &rbuf, 0)) { + goto done; + } + + /* Return output parameters */ + + result = r.status; + + done: + prs_mem_free(&qbuf); + prs_mem_free(&rbuf); + + return result; +} + /* Query user security object */ NTSTATUS cli_samr_query_sec_obj(struct cli_state *cli, TALLOC_CTX *mem_ctx, |