/* Lookup sid from winbindd */
- memset(dom_name, '\0', sizeof(dom_name));
- memset(name, '\0', sizeof(name));
-
status = lookup_sid(&find_sid, dom_name, name, &sid_name_use);
DEBUG(5, ("init_lsa_trans_names: %s\n", status ? "found" :
if (!status) {
sid_name_use = SID_NAME_UNKNOWN;
+ memset(dom_name, '\0', sizeof(dom_name));
+ sid_to_string(name, &find_sid);
+ dom_idx = -1;
+
+ DEBUG(10,("init_lsa_trans_names: added unknown user '%s' to "
+ "referenced list.\n", name ));
} else {
(*mapped_count)++;
- }
+ /* Store domain sid in ref array */
+ if (find_sid.num_auths == 5) {
+ sid_split_rid(&find_sid, &rid);
+ }
+ dom_idx = init_dom_ref(ref, dom_name, &find_sid);
- /* Store domain sid in ref array */
+ DEBUG(10,("init_lsa_trans_names: added user '%s\\%s' to "
+ "referenced list.\n", dom_name, name ));
- if (find_sid.num_auths == 5) {
- sid_split_rid(&find_sid, &rid);
}
- dom_idx = init_dom_ref(ref, dom_name, &find_sid);
-
- DEBUG(10,("init_lsa_trans_names: added user '%s\\%s' to "
- "referenced list.\n", dom_name, name ));
-
init_lsa_trans_name(&trn->name[total], &trn->uni_name[total],
sid_name_use, name, dom_idx);
total++;
r_l->dom_ref = ref;
r_l->names = names;
r_l->mapped_count = mapped_count;
-
- if (mapped_count == 0)
- r_l->status = NT_STATUS_NONE_MAPPED;
- else
- r_l->status = NT_STATUS_OK;
}
static NTSTATUS lsa_get_generic_sd(TALLOC_CTX *mem_ctx, SEC_DESC **sd, size_t *sd_size)
/* set up the LSA Lookup SIDs response */
init_lsa_trans_names(p->mem_ctx, ref, names, num_entries, sid, &mapped_count);
+ if (mapped_count == 0)
+ r_u->status = NT_STATUS_NONE_MAPPED;
+ else if (mapped_count != num_entries)
+ r_u->status = STATUS_SOME_UNMAPPED;
+ else
+ r_u->status = NT_STATUS_OK;
init_reply_lookup_sids(r_u, ref, names, mapped_count);
return r_u->status;