diff options
author | Tim Potter <tpot@samba.org> | 2001-06-20 07:08:28 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-06-20 07:08:28 +0000 |
commit | 401a0174009b82f02c0fd45ce50dfa849c67befc (patch) | |
tree | d593c9ef98f4665bc71becbbc03e30b0fa933679 /source3 | |
parent | 5ebfcadf81e174d079ad6f6b1c1698b5b26822b5 (diff) | |
download | samba-401a0174009b82f02c0fd45ce50dfa849c67befc.tar.gz samba-401a0174009b82f02c0fd45ce50dfa849c67befc.tar.bz2 samba-401a0174009b82f02c0fd45ce50dfa849c67befc.zip |
Added cli_samr_delete_dom_user() function.
(This used to be commit 2162454d9ea5a07892d0b5d7fc5abe7251b4fa98)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/cli_samr.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/source3/libsmb/cli_samr.c b/source3/libsmb/cli_samr.c index f8dd8040c9..29f136427d 100644 --- a/source3/libsmb/cli_samr.c +++ b/source3/libsmb/cli_samr.c @@ -1074,3 +1074,47 @@ uint32 cli_samr_set_userinfo2(struct cli_state *cli, TALLOC_CTX *mem_ctx, return result; } + +/* Delete domain user */ + +uint32 cli_samr_delete_dom_user(struct cli_state *cli, TALLOC_CTX *mem_ctx, + POLICY_HND *user_pol) +{ + prs_struct qbuf, rbuf; + SAMR_Q_DELETE_DOM_USER q; + SAMR_R_DELETE_DOM_USER r; + uint32 result = NT_STATUS_UNSUCCESSFUL; + + 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_delete_dom_user(&q, user_pol); + + if (!samr_io_q_delete_dom_user("", &q, &qbuf, 0) || + !rpc_api_pipe_req(cli, SAMR_DELETE_DOM_USER, &qbuf, &rbuf)) { + goto done; + } + + /* Unmarshall response */ + + if (!samr_io_r_delete_dom_user("", &r, &rbuf, 0)) { + goto done; + } + + /* Return output parameters */ + + result = r.status; + + done: + prs_mem_free(&qbuf); + prs_mem_free(&rbuf); + + return result; +} |