diff options
author | Jeremy Allison <jra@samba.org> | 2004-05-20 18:28:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:46 -0500 |
commit | 52ddd54083e5875c5ef7bd8e1cdd996289004982 (patch) | |
tree | eea730904d494a7548f65ae21e93d94bc71b80d2 | |
parent | 67d474861d34490f6a8064d3eadc716d5a3a6020 (diff) | |
download | samba-52ddd54083e5875c5ef7bd8e1cdd996289004982.tar.gz samba-52ddd54083e5875c5ef7bd8e1cdd996289004982.tar.bz2 samba-52ddd54083e5875c5ef7bd8e1cdd996289004982.zip |
r801: Fix from "Jianliang Lu" <j.lu@tiesse.com> to return correct group
types.
Jeremy.
(This used to be commit d97b9146a137d43278f3125bafe8a453da82f4ce)
-rw-r--r-- | source3/passdb/passdb.c | 18 | ||||
-rw-r--r-- | source3/passdb/util_sam_sid.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 8313a259bd..75f8171a25 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -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; } diff --git a/source3/passdb/util_sam_sid.c b/source3/passdb/util_sam_sid.c index 45ffe2460b..c13159e47f 100644 --- a/source3/passdb/util_sam_sid.c +++ b/source3/passdb/util_sam_sid.c @@ -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; diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 3878734c6d..1d7fdb0e54 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -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")); |