1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r5469: Fix error codes of samr_lookup_rids: There's also STATUS_SOME_UNMAPPED.

Thanks,

Volker
This commit is contained in:
Volker Lendecke 2005-02-20 14:26:58 +00:00 committed by Gerald (Jerry) Carter
parent e1c3ca182b
commit 43dcf0f5cb
3 changed files with 32 additions and 14 deletions

View File

@ -1649,9 +1649,11 @@ NTSTATUS cli_samr_lookup_rids(struct cli_state *cli, TALLOC_CTX *mem_ctx,
/* Return output parameters */
if (!NT_STATUS_IS_OK(result = r.status)) {
result = r.status;
if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED))
goto done;
}
if (r.num_names1 == 0) {
*num_names = 0;

View File

@ -1510,7 +1510,9 @@ NTSTATUS _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOK
int num_rids = q_u->num_rids1;
int i;
uint32 acc_granted;
BOOL have_mapped = False;
BOOL have_unmapped = False;
r_u->status = NT_STATUS_OK;
DEBUG(5,("_samr_lookup_rids: %d\n", __LINE__));
@ -1529,7 +1531,11 @@ NTSTATUS _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOK
return NT_STATUS_NO_MEMORY;
}
r_u->status = NT_STATUS_NONE_MAPPED;
if (!sid_equal(&pol_sid, get_global_sam_sid())) {
/* TODO: Sooner or later we need to look up BUILTIN rids as
* well. -- vl */
goto done;
}
become_root(); /* lookup_sid can require root privs */
@ -1542,21 +1548,30 @@ NTSTATUS _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOK
group_attrs[i] = SID_NAME_UNKNOWN;
*group_names[i] = '\0';
if (sid_equal(&pol_sid, get_global_sam_sid())) {
sid_copy(&sid, &pol_sid);
sid_append_rid(&sid, q_u->rid[i]);
sid_copy(&sid, &pol_sid);
sid_append_rid(&sid, q_u->rid[i]);
if (lookup_sid(&sid, domname, tmpname, &type)) {
r_u->status = NT_STATUS_OK;
group_attrs[i] = (uint32)type;
fstrcpy(group_names[i],tmpname);
DEBUG(5,("_samr_lookup_rids: %s:%d\n", group_names[i], group_attrs[i]));
}
if (lookup_sid(&sid, domname, tmpname, &type)) {
group_attrs[i] = (uint32)type;
fstrcpy(group_names[i],tmpname);
DEBUG(5,("_samr_lookup_rids: %s:%d\n", group_names[i],
group_attrs[i]));
have_mapped = True;
} else {
have_unmapped = True;
}
}
unbecome_root();
done:
r_u->status = NT_STATUS_NONE_MAPPED;
if (have_mapped)
r_u->status =
have_unmapped ? STATUS_SOME_UNMAPPED : NT_STATUS_OK;
if(!make_samr_lookup_rids(p->mem_ctx, num_rids, group_names, &hdr_name, &uni_name))
return NT_STATUS_NO_MEMORY;

View File

@ -1431,7 +1431,8 @@ static NTSTATUS cmd_samr_lookup_rids(struct cli_state *cli,
flags, num_rids, rids,
&num_names, &names, &name_types);
if (!NT_STATUS_IS_OK(result))
if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED))
goto done;
/* Display results */