diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_samr.c | 23 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 34 |
2 files changed, 14 insertions, 43 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 84bcff687f..fc5edcc7f6 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -729,28 +729,7 @@ static bool api_samr_query_groupmem(pipes_struct *p) static bool api_samr_add_aliasmem(pipes_struct *p) { - SAMR_Q_ADD_ALIASMEM q_u; - SAMR_R_ADD_ALIASMEM r_u; - - prs_struct *data = &p->in_data.data; - prs_struct *rdata = &p->out_data.rdata; - - ZERO_STRUCT(q_u); - ZERO_STRUCT(r_u); - - if (!samr_io_q_add_aliasmem("", &q_u, data, 0)) { - DEBUG(0,("api_samr_add_aliasmem: unable to unmarshall SAMR_Q_ADD_ALIASMEM.\n")); - return False; - } - - r_u.status = _samr_add_aliasmem(p, &q_u, &r_u); - - if (!samr_io_r_add_aliasmem("", &r_u, rdata, 0)) { - DEBUG(0,("api_samr_add_aliasmem: unable to marshall SAMR_R_ADD_ALIASMEM.\n")); - return False; - } - - return True; + return proxy_samr_call(p, NDR_SAMR_ADDALIASMEMBER); } /******************************************************************* diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index e748d677c4..c62fc7829f 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -3961,26 +3961,28 @@ NTSTATUS _samr_query_groupmem(pipes_struct *p, SAMR_Q_QUERY_GROUPMEM *q_u, SAMR_ } /********************************************************************* - _samr_add_aliasmem + _samr_AddAliasMember *********************************************************************/ -NTSTATUS _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_ADD_ALIASMEM *r_u) +NTSTATUS _samr_AddAliasMember(pipes_struct *p, + struct samr_AddAliasMember *r) { DOM_SID alias_sid; uint32 acc_granted; SE_PRIV se_rights; bool can_add_accounts; - NTSTATUS ret; + NTSTATUS status; DISP_INFO *disp_info = NULL; /* Find the policy handle. Open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->alias_pol, &alias_sid, &acc_granted, &disp_info)) + if (!get_lsa_policy_samr_sid(p, r->in.alias_handle, &alias_sid, &acc_granted, &disp_info)) return NT_STATUS_INVALID_HANDLE; - - if (!NT_STATUS_IS_OK(r_u->status = access_check_samr_function(acc_granted, SA_RIGHT_ALIAS_ADD_MEMBER, "_samr_add_aliasmem"))) { - return r_u->status; + + status = access_check_samr_function(acc_granted, SA_RIGHT_ALIAS_ADD_MEMBER, "_samr_AddAliasMember"); + if (!NT_STATUS_IS_OK(status)) { + return status; } - + DEBUG(10, ("sid is %s\n", sid_string_dbg(&alias_sid))); se_priv_copy( &se_rights, &se_add_users ); @@ -3991,18 +3993,18 @@ NTSTATUS _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_AD if ( can_add_accounts ) become_root(); - ret = pdb_add_aliasmem(&alias_sid, &q_u->sid.sid); + status = pdb_add_aliasmem(&alias_sid, r->in.sid); if ( can_add_accounts ) unbecome_root(); /******** END SeAddUsers BLOCK *********/ - if (NT_STATUS_IS_OK(ret)) { + if (NT_STATUS_IS_OK(status)) { force_flush_samr_cache(disp_info); } - return ret; + return status; } /********************************************************************* @@ -5248,16 +5250,6 @@ NTSTATUS _samr_SetAliasInfo(pipes_struct *p, /**************************************************************** ****************************************************************/ -NTSTATUS _samr_AddAliasMember(pipes_struct *p, - struct samr_AddAliasMember *r) -{ - p->rng_fault_state = true; - return NT_STATUS_NOT_IMPLEMENTED; -} - -/**************************************************************** -****************************************************************/ - NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, struct samr_GetMembersInAlias *r) { |