summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-04 18:36:44 +0100
committerGünther Deschner <gd@samba.org>2008-02-04 18:41:46 +0100
commit062820eaee624ac1c02e695d26b5ad4a0b0f66d9 (patch)
treefb8459e140133f3e7e0a1e70a37d2d4804b200c3 /source3/rpc_server
parentc01a62c4d637adedd4e0e41b5f36e2e3ac6f5357 (diff)
downloadsamba-062820eaee624ac1c02e695d26b5ad4a0b0f66d9.tar.gz
samba-062820eaee624ac1c02e695d26b5ad4a0b0f66d9.tar.bz2
samba-062820eaee624ac1c02e695d26b5ad4a0b0f66d9.zip
Use pidl for _samr_AddGroupMember().
Guenther (This used to be commit 4f923d970eac5841d1f67dbb8fc0c1dd1fda95a3)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr.c23
-rw-r--r--source3/rpc_server/srv_samr_nt.c31
2 files changed, 13 insertions, 41 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index ddefa569cf..15cbf4cb61 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -810,28 +810,7 @@ static bool api_samr_del_aliasmem(pipes_struct *p)
static bool api_samr_add_groupmem(pipes_struct *p)
{
- SAMR_Q_ADD_GROUPMEM q_u;
- SAMR_R_ADD_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_add_groupmem("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_add_groupmem: unable to unmarshall SAMR_Q_ADD_GROUPMEM.\n"));
- return False;
- }
-
- r_u.status = _samr_add_groupmem(p, &q_u, &r_u);
-
- if (!samr_io_r_add_groupmem("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_add_groupmem: unable to marshall SAMR_R_ADD_GROUPMEM.\n"));
- return False;
- }
-
- return True;
+ return proxy_samr_call(p, NDR_SAMR_ADDGROUPMEMBER);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index e394dc1d57..95c31ebc8b 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -4053,11 +4053,13 @@ NTSTATUS _samr_del_aliasmem(pipes_struct *p, SAMR_Q_DEL_ALIASMEM *q_u, SAMR_R_DE
}
/*********************************************************************
- _samr_add_groupmem
+ _samr_AddGroupMember
*********************************************************************/
-NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_ADD_GROUPMEM *r_u)
+NTSTATUS _samr_AddGroupMember(pipes_struct *p,
+ struct samr_AddGroupMember *r)
{
+ NTSTATUS status;
DOM_SID group_sid;
uint32 group_rid;
uint32 acc_granted;
@@ -4066,11 +4068,12 @@ NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_AD
DISP_INFO *disp_info = NULL;
/* 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_ADD_MEMBER, "_samr_add_groupmem"))) {
- return r_u->status;
+
+ status = access_check_samr_function(acc_granted, SA_RIGHT_GROUP_ADD_MEMBER, "_samr_AddGroupMember");
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
DEBUG(10, ("sid is %s\n", sid_string_dbg(&group_sid)));
@@ -4088,8 +4091,8 @@ NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_AD
if ( can_add_accounts )
become_root();
- r_u->status = pdb_add_groupmem(p->mem_ctx, group_rid, q_u->rid);
-
+ status = pdb_add_groupmem(p->mem_ctx, group_rid, r->in.rid);
+
if ( can_add_accounts )
unbecome_root();
@@ -4097,7 +4100,7 @@ NTSTATUS _samr_add_groupmem(pipes_struct *p, SAMR_Q_ADD_GROUPMEM *q_u, SAMR_R_AD
force_flush_samr_cache(disp_info);
- return r_u->status;
+ return status;
}
/*********************************************************************
@@ -5204,16 +5207,6 @@ NTSTATUS _samr_SetGroupInfo(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_AddGroupMember(pipes_struct *p,
- struct samr_AddGroupMember *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_QueryGroupMember(pipes_struct *p,
struct samr_QueryGroupMember *r)
{