summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_samr.c24
-rw-r--r--source3/rpc_server/srv_samr_nt.c73
2 files changed, 35 insertions, 62 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index d88033056a..2321d56b77 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -218,29 +218,7 @@ static bool api_samr_query_aliasinfo(pipes_struct *p)
static bool api_samr_lookup_names(pipes_struct *p)
{
- SAMR_Q_LOOKUP_NAMES q_u;
- SAMR_R_LOOKUP_NAMES 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 lookup names */
- if(!samr_io_q_lookup_names("", &q_u, data, 0)) {
- DEBUG(0,("api_samr_lookup_names: unable to unmarshall SAMR_Q_LOOKUP_NAMES.\n"));
- return False;
- }
-
- r_u.status = _samr_lookup_names(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!samr_io_r_lookup_names("", &r_u, rdata, 0)) {
- DEBUG(0,("api_samr_lookup_names: unable to marshall SAMR_R_LOOKUP_NAMES.\n"));
- return False;
- }
-
- return True;
+ return proxy_samr_call(p, NDR_SAMR_LOOKUPNAMES);
}
/*******************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 6d3bca8ab9..9ed7014bff 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1471,75 +1471,80 @@ NTSTATUS _samr_QueryAliasInfo(pipes_struct *p,
#endif
/*******************************************************************
- _samr_lookup_names
+ _samr_LookupNames
********************************************************************/
-NTSTATUS _samr_lookup_names(pipes_struct *p, SAMR_Q_LOOKUP_NAMES *q_u, SAMR_R_LOOKUP_NAMES *r_u)
+NTSTATUS _samr_LookupNames(pipes_struct *p,
+ struct samr_LookupNames *r)
{
+ NTSTATUS status;
uint32 rid[MAX_SAM_ENTRIES];
enum lsa_SidType type[MAX_SAM_ENTRIES];
int i;
- int num_rids = q_u->num_names2;
+ int num_rids = r->in.num_names;
DOM_SID pol_sid;
uint32 acc_granted;
+ struct samr_Ids rids, types;
- r_u->status = NT_STATUS_OK;
-
- DEBUG(5,("_samr_lookup_names: %d\n", __LINE__));
+ DEBUG(5,("_samr_LookupNames: %d\n", __LINE__));
ZERO_ARRAY(rid);
ZERO_ARRAY(type);
- if (!get_lsa_policy_samr_sid(p, &q_u->pol, &pol_sid, &acc_granted, NULL)) {
- init_samr_r_lookup_names(p->mem_ctx, r_u, 0, NULL, NULL, NT_STATUS_OBJECT_TYPE_MISMATCH);
- return r_u->status;
+ if (!get_lsa_policy_samr_sid(p, r->in.domain_handle, &pol_sid, &acc_granted, NULL)) {
+ return NT_STATUS_OBJECT_TYPE_MISMATCH;
}
- if (!NT_STATUS_IS_OK(r_u->status = access_check_samr_function(acc_granted, 0, "_samr_lookup_names"))) { /* Don't know the acc_bits yet */
- return r_u->status;
+ status = access_check_samr_function(acc_granted,
+ 0, /* Don't know the acc_bits yet */
+ "_samr_LookupNames");
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
if (num_rids > MAX_SAM_ENTRIES) {
num_rids = MAX_SAM_ENTRIES;
- DEBUG(5,("_samr_lookup_names: truncating entries to %d\n", num_rids));
+ DEBUG(5,("_samr_LookupNames: truncating entries to %d\n", num_rids));
}
- DEBUG(5,("_samr_lookup_names: looking name on SID %s\n",
+ DEBUG(5,("_samr_LookupNames: looking name on SID %s\n",
sid_string_dbg(&pol_sid)));
for (i = 0; i < num_rids; i++) {
- fstring name;
- int ret;
- r_u->status = NT_STATUS_NONE_MAPPED;
+ status = NT_STATUS_NONE_MAPPED;
type[i] = SID_NAME_UNKNOWN;
- rid [i] = 0xffffffff;
-
- ret = rpcstr_pull(name, q_u->uni_name[i].buffer, sizeof(name), q_u->uni_name[i].uni_str_len*2, 0);
-
- if (ret <= 0) {
- continue;
- }
+ rid[i] = 0xffffffff;
if (sid_check_is_builtin(&pol_sid)) {
- if (lookup_builtin_name(name, &rid[i])) {
+ if (lookup_builtin_name(r->in.names[i].string,
+ &rid[i]))
+ {
type[i] = SID_NAME_ALIAS;
}
} else {
- lookup_global_sam_name(name, 0, &rid[i], &type[i]);
+ lookup_global_sam_name(r->in.names[i].string, 0,
+ &rid[i], &type[i]);
}
if (type[i] != SID_NAME_UNKNOWN) {
- r_u->status = NT_STATUS_OK;
+ status = NT_STATUS_OK;
}
}
- init_samr_r_lookup_names(p->mem_ctx, r_u, num_rids, rid, type, r_u->status);
+ rids.count = num_rids;
+ rids.ids = rid;
- DEBUG(5,("_samr_lookup_names: %d\n", __LINE__));
+ types.count = num_rids;
+ types.ids = type;
- return r_u->status;
+ *r->out.rids = rids;
+ *r->out.types = types;
+
+ DEBUG(5,("_samr_LookupNames: %d\n", __LINE__));
+
+ return status;
}
/*******************************************************************
@@ -5225,16 +5230,6 @@ NTSTATUS _samr_EnumDomainAliases(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_LookupNames(pipes_struct *p,
- struct samr_LookupNames *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p,
struct samr_SetMemberAttributesOfGroup *r)
{