mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
r801: Fix from "Jianliang Lu" <j.lu@tiesse.com> to return correct group
types. Jeremy.
This commit is contained in:
parent
fac9074113
commit
d97b9146a1
@ -814,13 +814,13 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
|
||||
|
||||
BOOL local_lookup_name(const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psid_name_use)
|
||||
{
|
||||
extern DOM_SID global_sid_World_Domain;
|
||||
DOM_SID local_sid;
|
||||
DOM_SID sid;
|
||||
fstring user;
|
||||
SAM_ACCOUNT *sam_account = NULL;
|
||||
struct group *grp;
|
||||
GROUP_MAP map;
|
||||
|
||||
|
||||
*psid_name_use = SID_NAME_UNKNOWN;
|
||||
|
||||
/*
|
||||
@ -832,14 +832,12 @@ BOOL local_lookup_name(const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psi
|
||||
|
||||
sid_copy(&local_sid, get_global_sam_sid());
|
||||
|
||||
/*
|
||||
* Special case for MACHINE\Everyone. Map to the world_sid.
|
||||
*/
|
||||
|
||||
if(strequal(user, "Everyone")) {
|
||||
sid_copy( psid, &global_sid_World_Domain);
|
||||
sid_append_rid(psid, 0);
|
||||
*psid_name_use = SID_NAME_ALIAS;
|
||||
if (map_name_to_wellknown_sid(&sid, psid_name_use, user)){
|
||||
fstring sid_str;
|
||||
sid_copy( psid, &sid);
|
||||
sid_to_string(sid_str, &sid);
|
||||
DEBUG(10,("lookup_name: name %s = SID %s, type = %u\n", user, sid_str,
|
||||
(unsigned int)*psid_name_use ));
|
||||
return True;
|
||||
}
|
||||
|
||||
|
@ -294,6 +294,8 @@ BOOL map_name_to_wellknown_sid(DOM_SID *sid, enum SID_NAME_USE *use, const char
|
||||
if (!sid_name_map_initialized)
|
||||
init_sid_name_map();
|
||||
|
||||
DEBUG(10,("map_name_to_wellknown_sid: looking up %s\n", name));
|
||||
|
||||
for (i=0; sid_name_map[i].sid != NULL; i++) {
|
||||
const known_sid_users *users = sid_name_map[i].known_users;
|
||||
|
||||
|
@ -171,10 +171,12 @@ static void init_lsa_rid2s(DOM_R_REF *ref, DOM_RID2 *rid2,
|
||||
status = lookup_name(dom_name, user, &sid, &name_type);
|
||||
}
|
||||
|
||||
#if 0 /* This is not true. */
|
||||
if (name_type == SID_NAME_WKN_GRP) {
|
||||
/* BUILTIN aliases are still aliases :-) */
|
||||
name_type = SID_NAME_ALIAS;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG(5, ("init_lsa_rid2s: %s\n", status ? "found" :
|
||||
"not found"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user