summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-04 18:09:35 +0100
committerGünther Deschner <gd@samba.org>2008-02-04 18:32:24 +0100
commit4906b5037d09beceee67a455177269215c140206 (patch)
tree88beb3a70ffc0f0999ddf93159066f3b6eb771b7
parent381132872b72c054ed6d51b9d840194a5b3f877d (diff)
downloadsamba-4906b5037d09beceee67a455177269215c140206.tar.gz
samba-4906b5037d09beceee67a455177269215c140206.tar.bz2
samba-4906b5037d09beceee67a455177269215c140206.zip
Use pidl for _samr_DeleteGroupMember().
Guenther (This used to be commit 94d6536809266ea3a12cd255fb7f2f7a70c42da3)
-rw-r--r--source3/rpc_server/srv_samr.c23
-rw-r--r--source3/rpc_server/srv_samr_nt.c30
2 files changed, 13 insertions, 40 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index dd162c7479..ddefa569cf 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -840,28 +840,7 @@ static bool api_samr_add_groupmem(pipes_struct *p)
static bool api_samr_del_groupmem(pipes_struct *p)
{
- SAMR_Q_DEL_GROUPMEM q_u;
- SAMR_R_DEL_GROUPMEM 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_del_groupmem("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_del_groupmem: unable to unmarshall SAMR_Q_DEL_GROUPMEM.\n"));
- return False;
- }
-
- r_u.status = _samr_del_groupmem(p, &q_u, &r_u);
-
- if (!samr_io_r_del_groupmem("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_del_groupmem: unable to marshall SAMR_R_DEL_GROUPMEM.\n"));
- return False;
- }
-
- return True;
+ return proxy_samr_call(p, NDR_SAMR_DELETEGROUPMEMBER);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 4e0487f7ff..e394dc1d57 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -4101,11 +4101,14 @@ NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_AD
}
/*********************************************************************
- _samr_del_groupmem
+ _samr_DeleteGroupMember
*********************************************************************/
-NTSTATUS _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DEL_GROUPMEM *r_u)
+NTSTATUS _samr_DeleteGroupMember(pipes_struct *p,
+ struct samr_DeleteGroupMember *r)
+
{
+ NTSTATUS status;
DOM_SID group_sid;
uint32 group_rid;
uint32 acc_granted;
@@ -4114,17 +4117,18 @@ NTSTATUS _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DE
DISP_INFO *disp_info = NULL;
/*
- * delete the group member named q_u->rid
+ * delete the group member named r->in.rid
* who is a member of the sid associated with the handle
* the rid is a user's rid as the group is a domain group.
*/
/* Find the policy handle. Open a policy on it. */
- if (!get_lsa_policy_samr_sid(p, &q_u->pol, &group_sid, &acc_granted, &disp_info))
+ if (!get_lsa_policy_samr_sid(p, r->in.group_handle, &group_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_GROUP_REMOVE_MEMBER, "_samr_del_groupmem"))) {
- return r_u->status;
+ status = access_check_samr_function(acc_granted, SA_RIGHT_GROUP_REMOVE_MEMBER, "_samr_DeleteGroupMember");
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
if (!sid_peek_check_rid(get_global_sam_sid(), &group_sid,
@@ -4140,7 +4144,7 @@ NTSTATUS _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DE
if ( can_add_accounts )
become_root();
- r_u->status = pdb_del_groupmem(p->mem_ctx, group_rid, q_u->rid);
+ status = pdb_del_groupmem(p->mem_ctx, group_rid, r->in.rid);
if ( can_add_accounts )
unbecome_root();
@@ -4149,7 +4153,7 @@ NTSTATUS _samr_del_groupmem(pipes_struct *p, SAMR_Q_DEL_GROUPMEM *q_u, SAMR_R_DE
force_flush_samr_cache(disp_info);
- return r_u->status;
+ return status;
}
/*********************************************************************
@@ -5210,16 +5214,6 @@ NTSTATUS _samr_AddGroupMember(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_DeleteGroupMember(pipes_struct *p,
- struct samr_DeleteGroupMember *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_QueryGroupMember(pipes_struct *p,
struct samr_QueryGroupMember *r)
{