summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-01 22:18:48 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-01 22:18:48 +0000
commit5dd26daad55da89a7a0996caadd1d474f6031001 (patch)
treef0d519bc5135583dce830a30fd7e39534b10c080 /source3/rpc_server/srv_samr.c
parentb3c1baeb8067b1b1c59eb55d34334d10725b0a48 (diff)
downloadsamba-5dd26daad55da89a7a0996caadd1d474f6031001.tar.gz
samba-5dd26daad55da89a7a0996caadd1d474f6031001.tar.bz2
samba-5dd26daad55da89a7a0996caadd1d474f6031001.zip
query_aliasmem code. it works (hurrah).
(This used to be commit f7f2516df46dde1671235f788f7689c93d9395ae)
Diffstat (limited to 'source3/rpc_server/srv_samr.c')
-rw-r--r--source3/rpc_server/srv_samr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 0ba7d0871e..a02338bf34 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -862,7 +862,7 @@ static void samr_reply_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_u,
uint32 status = 0;
LOCAL_GRP_MEMBER *mem_grp = NULL;
- DOM_SID *sid = NULL;
+ DOM_SID2 *sid = NULL;
int num_sids = 0;
DOM_SID alias_sid;
uint32 alias_rid;
@@ -892,7 +892,7 @@ static void samr_reply_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_u,
DEBUG(10,("lookup on S-1-5-20\n"));
become_root(True);
- status = getbuiltinrid(alias_rid, &mem_grp, &num_sids) ? 0xC0000000 | NT_STATUS_NO_SUCH_GROUP : 0x0;
+ status = getbuiltinrid(alias_rid, &mem_grp, &num_sids) != NULL ? 0x0 : 0xC0000000 | NT_STATUS_NO_SUCH_GROUP;
unbecome_root(True);
}
else if (sid_equal(&alias_sid, &global_sam_sid))
@@ -900,7 +900,7 @@ static void samr_reply_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_u,
DEBUG(10,("lookup on Domain SID\n"));
become_root(True);
- status = getaliasrid(alias_rid, &mem_grp, &num_sids) ? 0xC0000000 | NT_STATUS_NO_SUCH_GROUP : 0x0;
+ status = getaliasrid(alias_rid, &mem_grp, &num_sids) != NULL ? 0x0 : 0xC0000000 | NT_STATUS_NO_SUCH_GROUP;
unbecome_root(True);
}
else
@@ -917,7 +917,7 @@ static void samr_reply_query_aliasmem(SAMR_Q_QUERY_ALIASMEM *q_u,
int i;
for (i = 0; i < num_sids; i++)
{
- sid[i] = mem_grp[i].sid;
+ make_dom_sid2(&sid[i], &mem_grp[i].sid);
}
free(mem_grp);
}
@@ -1773,6 +1773,11 @@ static void samr_reply_open_alias(SAMR_Q_OPEN_ALIAS *q_u,
/* set up the SAMR open_alias response */
r_u.status = 0x0;
+ if (r_u.status == 0x0 && !get_lsa_policy_samr_sid(&q_u->dom_pol, &sid))
+ {
+ r_u.status = 0xC0000000 | NT_STATUS_INVALID_HANDLE;
+ }
+
/* get a (unique) handle. open a policy on it. */
if (r_u.status == 0x0 && !(pol_open = open_lsa_policy_hnd(&(r_u.pol))))
{
@@ -1786,7 +1791,6 @@ static void samr_reply_open_alias(SAMR_Q_OPEN_ALIAS *q_u,
r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- sid_copy(&sid, &global_sid_S_1_5_20);
sid_append_rid(&sid, q_u->rid_alias);
/* associate an alias SID with the (unique) handle. */