diff options
Diffstat (limited to 'source/rpc_client')
-rw-r--r-- | source/rpc_client/cli_lsarpc.c | 12 | ||||
-rw-r--r-- | source/rpc_client/cli_samr.c | 48 |
2 files changed, 54 insertions, 6 deletions
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c index 98c2475a658..45b7509d451 100644 --- a/source/rpc_client/cli_lsarpc.c +++ b/source/rpc_client/cli_lsarpc.c @@ -1110,12 +1110,12 @@ NTSTATUS cli_lsa_enum_privsaccount(struct cli_state *cli, TALLOC_CTX *mem_ctx, /** Get a privilege value given its name */ -NTSTATUS cli_lsa_lookupprivvalue(struct cli_state *cli, TALLOC_CTX *mem_ctx, +NTSTATUS cli_lsa_lookup_priv_value(struct cli_state *cli, TALLOC_CTX *mem_ctx, POLICY_HND *pol, const char *name, LUID *luid) { prs_struct qbuf, rbuf; - LSA_Q_LOOKUPPRIVVALUE q; - LSA_R_LOOKUPPRIVVALUE r; + LSA_Q_LOOKUP_PRIV_VALUE q; + LSA_R_LOOKUP_PRIV_VALUE r; NTSTATUS result; ZERO_STRUCT(q); @@ -1128,9 +1128,9 @@ NTSTATUS cli_lsa_lookupprivvalue(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Marshall data and send request */ - init_lsa_q_lookupprivvalue(&q, pol, name); + init_lsa_q_lookup_priv_value(&q, pol, name); - if (!lsa_io_q_lookupprivvalue("", &q, &qbuf, 0) || + if (!lsa_io_q_lookup_priv_value("", &q, &qbuf, 0) || !rpc_api_pipe_req(cli, PI_LSARPC, LSA_LOOKUPPRIVVALUE, &qbuf, &rbuf)) { result = NT_STATUS_UNSUCCESSFUL; goto done; @@ -1138,7 +1138,7 @@ NTSTATUS cli_lsa_lookupprivvalue(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Unmarshall response */ - if (!lsa_io_r_lookupprivvalue("", &r, &rbuf, 0)) { + if (!lsa_io_r_lookup_priv_value("", &r, &rbuf, 0)) { result = NT_STATUS_UNSUCCESSFUL; goto done; } diff --git a/source/rpc_client/cli_samr.c b/source/rpc_client/cli_samr.c index 5473168c0f8..75751dbcbd6 100644 --- a/source/rpc_client/cli_samr.c +++ b/source/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, |