summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_samr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client/cli_samr.c')
-rw-r--r--source3/rpc_client/cli_samr.c500
1 files changed, 0 insertions, 500 deletions
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index bf8313816c..fa1e5a645b 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -95,201 +95,6 @@ NTSTATUS rpccli_samr_connect4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return result;
}
-/* Close SAMR handle */
-
-NTSTATUS rpccli_samr_close(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *connect_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_CLOSE_HND q;
- SAMR_R_CLOSE_HND r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_close\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_close_hnd(&q, connect_pol);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_CLOSE_HND,
- q, r,
- qbuf, rbuf,
- samr_io_q_close_hnd,
- samr_io_r_close_hnd,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
-#ifdef __INSURE__
- SAFE_FREE(connect_pol->marker);
-#endif
- *connect_pol = r.pol;
- }
-
- return result;
-}
-
-/* Open handle on a domain */
-
-NTSTATUS rpccli_samr_open_domain(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *connect_pol, uint32 access_mask,
- const DOM_SID *domain_sid,
- POLICY_HND *domain_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_OPEN_DOMAIN q;
- SAMR_R_OPEN_DOMAIN r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_open_domain with sid %s\n",
- sid_string_dbg(domain_sid) ));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_open_domain(&q, connect_pol, access_mask, domain_sid);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_OPEN_DOMAIN,
- q, r,
- qbuf, rbuf,
- samr_io_q_open_domain,
- samr_io_r_open_domain,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
- *domain_pol = r.domain_pol;
-#ifdef __INSURE__
- domain_pol->marker = malloc(1);
-#endif
- }
-
- return result;
-}
-
-NTSTATUS rpccli_samr_open_user(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol, uint32 access_mask,
- uint32 user_rid, POLICY_HND *user_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_OPEN_USER q;
- SAMR_R_OPEN_USER r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_open_user with rid 0x%x\n", user_rid ));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_open_user(&q, domain_pol, access_mask, user_rid);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_OPEN_USER,
- q, r,
- qbuf, rbuf,
- samr_io_q_open_user,
- samr_io_r_open_user,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
- *user_pol = r.user_pol;
-#ifdef __INSURE__
- user_pol->marker = malloc(1);
-#endif
- }
-
- return result;
-}
-
-/* Open handle on a group */
-
-NTSTATUS rpccli_samr_open_group(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol, uint32 access_mask,
- uint32 group_rid, POLICY_HND *group_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_OPEN_GROUP q;
- SAMR_R_OPEN_GROUP r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_open_group with rid 0x%x\n", group_rid ));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_open_group(&q, domain_pol, access_mask, group_rid);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_OPEN_GROUP,
- q, r,
- qbuf, rbuf,
- samr_io_q_open_group,
- samr_io_r_open_group,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
- *group_pol = r.pol;
-#ifdef __INSURE__
- group_pol->marker = malloc(1);
-#endif
- }
-
- return result;
-}
-
-/* Create domain group */
-
-NTSTATUS rpccli_samr_create_dom_group(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol,
- const char *group_name,
- uint32 access_mask, POLICY_HND *group_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_CREATE_DOM_GROUP q;
- SAMR_R_CREATE_DOM_GROUP r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_create_dom_group\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_create_dom_group(&q, domain_pol, group_name, access_mask);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_CREATE_DOM_GROUP,
- q, r,
- qbuf, rbuf,
- samr_io_q_create_dom_group,
- samr_io_r_create_dom_group,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- if (NT_STATUS_IS_OK(result))
- *group_pol = r.pol;
-
- return result;
-}
-
/* Add a domain group member */
NTSTATUS rpccli_samr_add_groupmem(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
@@ -908,82 +713,6 @@ NTSTATUS rpccli_samr_query_aliasmem(struct rpc_pipe_client *cli,
return result;
}
-/* Open handle on an alias */
-
-NTSTATUS rpccli_samr_open_alias(struct rpc_pipe_client *cli,
- TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol, uint32 access_mask,
- uint32 alias_rid, POLICY_HND *alias_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_OPEN_ALIAS q;
- SAMR_R_OPEN_ALIAS r;
- NTSTATUS result;
-
- DEBUG(10,("cli_samr_open_alias with rid 0x%x\n", alias_rid));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_open_alias(&q, domain_pol, access_mask, alias_rid);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_OPEN_ALIAS,
- q, r,
- qbuf, rbuf,
- samr_io_q_open_alias,
- samr_io_r_open_alias,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
- *alias_pol = r.pol;
-#ifdef __INSURE__
- alias_pol->marker = malloc(1);
-#endif
- }
-
- return result;
-}
-
-/* Create an alias */
-
-NTSTATUS rpccli_samr_create_dom_alias(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol, const char *name,
- POLICY_HND *alias_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_CREATE_DOM_ALIAS q;
- SAMR_R_CREATE_DOM_ALIAS r;
- NTSTATUS result;
-
- DEBUG(10,("cli_samr_create_dom_alias named %s\n", name));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_create_dom_alias(&q, domain_pol, name);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_CREATE_DOM_ALIAS,
- q, r,
- qbuf, rbuf,
- samr_io_q_create_dom_alias,
- samr_io_r_create_dom_alias,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (NT_STATUS_IS_OK(result = r.status)) {
- *alias_pol = r.alias_pol;
- }
-
- return result;
-}
-
/* Add an alias member */
NTSTATUS rpccli_samr_add_aliasmem(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
@@ -1639,51 +1368,6 @@ NTSTATUS rpccli_samr_lookup_names(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
return result;
}
-/* Create a domain user */
-
-NTSTATUS rpccli_samr_create_dom_user(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *domain_pol, const char *acct_name,
- uint32 acb_info, uint32 access_mask,
- POLICY_HND *user_pol, uint32 *rid)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_CREATE_USER q;
- SAMR_R_CREATE_USER r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_create_dom_user %s\n", acct_name));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_create_user(&q, domain_pol, acct_name, acb_info, access_mask);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_CREATE_USER,
- q, r,
- qbuf, rbuf,
- samr_io_q_create_user,
- samr_io_r_create_user,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- if (!NT_STATUS_IS_OK(result = r.status)) {
- goto done;
- }
-
- if (user_pol)
- *user_pol = r.user_pol;
-
- if (rid)
- *rid = r.user_rid;
-
- done:
-
- return result;
-}
-
/* Set userinfo */
NTSTATUS rpccli_samr_set_userinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
@@ -1778,105 +1462,6 @@ NTSTATUS rpccli_samr_set_userinfo2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
return result;
}
-/* Delete domain group */
-
-NTSTATUS rpccli_samr_delete_dom_group(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *group_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_DELETE_DOM_GROUP q;
- SAMR_R_DELETE_DOM_GROUP r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_delete_dom_group\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_delete_dom_group(&q, group_pol);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_DELETE_DOM_GROUP,
- q, r,
- qbuf, rbuf,
- samr_io_q_delete_dom_group,
- samr_io_r_delete_dom_group,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- return result;
-}
-
-/* Delete domain alias */
-
-NTSTATUS rpccli_samr_delete_dom_alias(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *alias_pol)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_DELETE_DOM_ALIAS q;
- SAMR_R_DELETE_DOM_ALIAS r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_delete_dom_alias\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_delete_dom_alias(&q, alias_pol);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_DELETE_DOM_ALIAS,
- q, r,
- qbuf, rbuf,
- samr_io_q_delete_dom_alias,
- samr_io_r_delete_dom_alias,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- return result;
-}
-
-/* Delete domain user */
-
-NTSTATUS rpccli_samr_delete_dom_user(struct rpc_pipe_client *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;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_delete_dom_user\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_delete_dom_user(&q, user_pol);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_DELETE_DOM_USER,
- q, r,
- qbuf, rbuf,
- samr_io_q_delete_dom_user,
- samr_io_r_delete_dom_user,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- return result;
-}
-
/* Remove foreign SID */
NTSTATUS rpccli_samr_remove_sid_foreign_domain(struct rpc_pipe_client *cli,
@@ -1981,91 +1566,6 @@ NTSTATUS rpccli_samr_set_sec_obj(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
return result;
}
-
-/* Get domain password info */
-
-NTSTATUS rpccli_samr_get_dom_pwinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- uint16 *min_pwd_length, uint32 *password_properties)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_GET_DOM_PWINFO q;
- SAMR_R_GET_DOM_PWINFO r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_get_dom_pwinfo\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_get_dom_pwinfo(&q, cli->cli->desthost);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_GET_DOM_PWINFO,
- q, r,
- qbuf, rbuf,
- samr_io_q_get_dom_pwinfo,
- samr_io_r_get_dom_pwinfo,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- if (NT_STATUS_IS_OK(result)) {
- if (min_pwd_length)
- *min_pwd_length = r.min_pwd_length;
- if (password_properties)
- *password_properties = r.password_properties;
- }
-
- return result;
-}
-
-/* Get domain password info */
-
-NTSTATUS rpccli_samr_get_usrdom_pwinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
- POLICY_HND *pol, uint16 *min_pwd_length,
- uint32 *password_properties, uint32 *unknown1)
-{
- prs_struct qbuf, rbuf;
- SAMR_Q_GET_USRDOM_PWINFO q;
- SAMR_R_GET_USRDOM_PWINFO r;
- NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-
- DEBUG(10,("cli_samr_get_usrdom_pwinfo\n"));
-
- ZERO_STRUCT(q);
- ZERO_STRUCT(r);
-
- /* Marshall data and send request */
-
- init_samr_q_get_usrdom_pwinfo(&q, pol);
-
- CLI_DO_RPC(cli, mem_ctx, PI_SAMR, SAMR_GET_USRDOM_PWINFO,
- q, r,
- qbuf, rbuf,
- samr_io_q_get_usrdom_pwinfo,
- samr_io_r_get_usrdom_pwinfo,
- NT_STATUS_UNSUCCESSFUL);
-
- /* Return output parameters */
-
- result = r.status;
-
- if (NT_STATUS_IS_OK(result)) {
- if (min_pwd_length)
- *min_pwd_length = r.min_pwd_length;
- if (password_properties)
- *password_properties = r.password_properties;
- if (unknown1)
- *unknown1 = r.unknown_1;
- }
-
- return result;
-}
-
-
/* Lookup Domain Name */
NTSTATUS rpccli_samr_lookup_domain(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,