1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

Use rpccli_samr_OpenUser() all over the place.

Guenther
(This used to be commit da90eb7653554d242da83ed98adae35ced3a2938)
This commit is contained in:
Günther Deschner 2008-02-01 11:57:53 +01:00
parent e8c794fabe
commit 37b56c0113
7 changed files with 110 additions and 64 deletions

View File

@ -724,9 +724,11 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
user_rid = user_rids[0];
status = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED, user_rid,
&user_pol);
status = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
@ -869,9 +871,11 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
user_rid = user_rids[0];
status = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid, &user_pol);
status = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}

View File

@ -382,9 +382,11 @@ static NTSTATUS cmd_samr_query_user(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
result = rpccli_samr_open_user(cli, mem_ctx, &domain_pol,
access_mask,
user_rid, &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
access_mask,
user_rid,
&user_pol);
if (NT_STATUS_EQUAL(result, NT_STATUS_NO_SUCH_USER) &&
(user_rid == 0)) {
@ -399,10 +401,11 @@ static NTSTATUS cmd_samr_query_user(struct rpc_pipe_client *cli,
&types);
if (NT_STATUS_IS_OK(result)) {
result = rpccli_samr_open_user(cli, mem_ctx,
&domain_pol,
access_mask,
rids[0], &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
access_mask,
rids[0],
&user_pol);
}
}
@ -645,9 +648,11 @@ static NTSTATUS cmd_samr_query_usergroups(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
result = rpccli_samr_open_user(cli, mem_ctx, &domain_pol,
access_mask,
user_rid, &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
access_mask,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -1952,9 +1957,11 @@ static NTSTATUS cmd_samr_delete_dom_user(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
result = rpccli_samr_open_user(cli, mem_ctx, &domain_pol,
access_mask,
user_rids[0], &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
access_mask,
user_rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -2033,9 +2040,11 @@ static NTSTATUS cmd_samr_query_sec_obj(struct rpc_pipe_client *cli,
goto done;
if (user_rid)
result = rpccli_samr_open_user(cli, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rid, &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(result))
goto done;
@ -2101,9 +2110,11 @@ static NTSTATUS cmd_samr_get_usrdom_pwinfo(struct rpc_pipe_client *cli,
goto done;
}
result = rpccli_samr_open_user(cli, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rid, &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rid,
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;

View File

@ -101,8 +101,11 @@ NTSTATUS netdom_leave_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli,
/* Open handle on user */
status = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED, user_rid, &user_pol);
status = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol);
if ( !NT_STATUS_IS_OK(status) ) {
goto done;
}
@ -298,8 +301,11 @@ NTSTATUS netdom_join_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli,
/* Open handle on user */
status = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED, user_rid, &user_pol);
status = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(status)) {
return status;
}

View File

@ -652,9 +652,11 @@ static NTSTATUS rpc_user_add_internals(const DOM_SID *domain_sid,
goto done;
}
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@ -786,9 +788,11 @@ static NTSTATUS rpc_user_del_internals(const DOM_SID *domain_sid,
goto done;
}
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@ -896,8 +900,11 @@ static NTSTATUS rpc_user_rename_internals(const DOM_SID *domain_sid,
}
/* Open domain user */
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS, user_rid[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rid[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@ -1049,9 +1056,11 @@ static NTSTATUS rpc_user_password_internals(const DOM_SID *domain_sid,
goto done;
}
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@ -1160,9 +1169,11 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
if (!NT_STATUS_IS_OK(result)) goto done;
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rids[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) goto done;
result = rpccli_samr_query_usergroups(pipe_hnd, mem_ctx, &user_pol,
@ -1408,9 +1419,11 @@ static NTSTATUS rpc_sh_handle_user(TALLOC_CTX *mem_ctx,
goto done;
}
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rid, &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
rid,
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;
}
@ -1819,9 +1832,11 @@ static NTSTATUS rpc_group_delete_internals(const DOM_SID *domain_sid,
/* Check if group is anyone's primary group */
for (i = 0; i < num_members; i++)
{
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
group_rids[i], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
group_rids[i],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
d_fprintf(stderr, "Unable to open group member %d\n",group_rids[i]);
@ -5603,9 +5618,11 @@ static NTSTATUS rpc_trustdom_del_internals(const DOM_SID *domain_sid,
goto done;
}
result = rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0], &user_pol);
result = rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
MAXIMUM_ALLOWED_ACCESS,
user_rids[0],
&user_pol);
if (!NT_STATUS_IS_OK(result)) {
goto done;

View File

@ -303,9 +303,11 @@ int net_rpc_join_newstyle(int argc, const char **argv)
/* Open handle on user */
CHECK_RPC_ERR_DEBUG(
rpccli_samr_open_user(pipe_hnd, mem_ctx, &domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid, &user_pol),
rpccli_samr_OpenUser(pipe_hnd, mem_ctx,
&domain_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol),
("could not re-open existing user %s: %s\n",
acct_name, nt_errstr(result)));

View File

@ -1339,10 +1339,11 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
goto done;
}
status_tmp = rpccli_samr_open_user(samr_pipe, state->mem_ctx,
&samr_domain_handle,
MAXIMUM_ALLOWED_ACCESS,
my_info3->user_rid, &user_pol);
status_tmp = rpccli_samr_OpenUser(samr_pipe, state->mem_ctx,
&samr_domain_handle,
MAXIMUM_ALLOWED_ACCESS,
my_info3->user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(status_tmp)) {
DEBUG(3, ("could not open user handle on SAMR pipe: %s\n",

View File

@ -469,9 +469,11 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
return result;
/* Get user handle */
result = rpccli_samr_open_user(cli, mem_ctx, &dom_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED, user_rid,
&user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&dom_pol,
SEC_RIGHTS_MAXIMUM_ALLOWED,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(result))
return result;
@ -545,8 +547,11 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
return result;
/* Get user handle */
result = rpccli_samr_open_user(cli, mem_ctx, &dom_pol,
des_access, user_rid, &user_pol);
result = rpccli_samr_OpenUser(cli, mem_ctx,
&dom_pol,
des_access,
user_rid,
&user_pol);
if (!NT_STATUS_IS_OK(result))
return result;