summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-07 13:14:40 +0100
committerGünther Deschner <gd@samba.org>2008-02-07 13:34:57 +0100
commitf7ad51084c87e5063e231c9bf024a354349d6a21 (patch)
treed9287e8379773c0b4b12a9ffa53e6e64c8eb72b3 /source3/rpc_server
parente3b4db88074cc98eb9dfc4909b444b2576fcca5c (diff)
downloadsamba-f7ad51084c87e5063e231c9bf024a354349d6a21.tar.gz
samba-f7ad51084c87e5063e231c9bf024a354349d6a21.tar.bz2
samba-f7ad51084c87e5063e231c9bf024a354349d6a21.zip
Use pidl for _samr_QueryAliasInfo().
Guenther (This used to be commit 62dacea87ad2323870e5356a348d1d192b3fa888)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr.c24
-rw-r--r--source3/rpc_server/srv_samr_nt.c63
2 files changed, 35 insertions, 52 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 2fea3c17b0..70fe85d6c7 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -230,29 +230,7 @@ static bool api_samr_query_dispinfo(pipes_struct *p)
static bool api_samr_query_aliasinfo(pipes_struct *p)
{
- SAMR_Q_QUERY_ALIASINFO q_u;
- SAMR_R_QUERY_ALIASINFO r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- /* grab the samr open */
- if(!samr_io_q_query_aliasinfo("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_query_aliasinfo: unable to unmarshall SAMR_Q_QUERY_ALIASINFO.\n"));
- return False;
- }
-
- r_u.status = _samr_query_aliasinfo(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!samr_io_r_query_aliasinfo("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO.\n"));
- return False;
- }
-
- return True;
+ return proxy_samr_call(p, NDR_SAMR_QUERYALIASINFO);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 092624d29e..836ff3574f 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1341,25 +1341,36 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u,
}
/*******************************************************************
- samr_reply_query_aliasinfo
+ _samr_QueryAliasInfo
********************************************************************/
-NTSTATUS _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_R_QUERY_ALIASINFO *r_u)
+NTSTATUS _samr_QueryAliasInfo(pipes_struct *p,
+ struct samr_QueryAliasInfo *r)
{
DOM_SID sid;
struct acct_info info;
uint32 acc_granted;
NTSTATUS status;
+ union samr_AliasInfo *alias_info = NULL;
+ const char *alias_name = NULL;
+ const char *alias_description = NULL;
- r_u->status = NT_STATUS_OK;
+ DEBUG(5,("_samr_QueryAliasInfo: %d\n", __LINE__));
- DEBUG(5,("_samr_query_aliasinfo: %d\n", __LINE__));
+ alias_info = TALLOC_ZERO_P(p->mem_ctx, union samr_AliasInfo);
+ if (!alias_info) {
+ return NT_STATUS_NO_MEMORY;
+ }
/* find the policy handle. open a policy on it. */
- if (!get_lsa_policy_samr_sid(p, &q_u->pol, &sid, &acc_granted, NULL))
+ if (!get_lsa_policy_samr_sid(p, r->in.alias_handle, &sid, &acc_granted, NULL))
return NT_STATUS_INVALID_HANDLE;
- if (!NT_STATUS_IS_OK(r_u->status = access_check_samr_function(acc_granted, SA_RIGHT_ALIAS_LOOKUP_INFO, "_samr_query_aliasinfo"))) {
- return r_u->status;
+
+ status = access_check_samr_function(acc_granted,
+ SA_RIGHT_ALIAS_LOOKUP_INFO,
+ "_samr_QueryAliasInfo");
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
become_root();
@@ -1369,26 +1380,30 @@ NTSTATUS _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAM
if ( !NT_STATUS_IS_OK(status))
return status;
- if ( !(r_u->ctr = TALLOC_ZERO_P( p->mem_ctx, ALIAS_INFO_CTR )) )
- return NT_STATUS_NO_MEMORY;
-
+ /* FIXME: info contains fstrings */
+ alias_name = talloc_strdup(r, info.acct_name);
+ alias_description = talloc_strdup(r, info.acct_desc);
- switch (q_u->level ) {
- case 1:
- r_u->ctr->level = 1;
- init_samr_alias_info1(&r_u->ctr->alias.info1, info.acct_name, 1, info.acct_desc);
+ switch (r->in.level) {
+ case ALIASINFOALL:
+ init_samr_alias_info1(&alias_info->all,
+ alias_name,
+ 1,
+ alias_description);
break;
- case 3:
- r_u->ctr->level = 3;
- init_samr_alias_info3(&r_u->ctr->alias.info3, info.acct_desc);
+ case ALIASINFODESCRIPTION:
+ init_samr_alias_info3(&alias_info->description,
+ alias_description);
break;
default:
return NT_STATUS_INVALID_INFO_CLASS;
}
- DEBUG(5,("_samr_query_aliasinfo: %d\n", __LINE__));
+ *r->out.info = alias_info;
- return r_u->status;
+ DEBUG(5,("_samr_QueryAliasInfo: %d\n", __LINE__));
+
+ return NT_STATUS_OK;
}
#if 0
@@ -5218,16 +5233,6 @@ NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_QueryAliasInfo(pipes_struct *p,
- struct samr_QueryAliasInfo *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_QueryUserInfo(pipes_struct *p,
struct samr_QueryUserInfo *r)
{