r3875: Allow to look up at least or own sid in _lsa_lookup_sids.
authorGünther Deschner <gd@samba.org>
Fri, 19 Nov 2004 13:26:17 +0000 (13:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:22 +0000 (10:53 -0500)
This fixes Bugzilla #1076 and Exchange 5.5 SP4 can then be finally
installed on NT4 in a samba-controlled domain.

Guenther
(This used to be commit bb191c1098dea06bf2cd89276c74e32279fbb3d4)

source3/passdb/lookup_sid.c
source3/passdb/passdb.c
source3/rpc_server/srv_lsa_nt.c

index e40a71c1451ac75ffd1fe04321f6a68c54b87557..4df497461a4fa78e52e4667cb67ea6a09f49344f 100644 (file)
@@ -76,6 +76,13 @@ BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAM
        /* Check if this is our own sid.  This should perhaps be done by
           winbind?  For the moment handle it here. */
 
+       if (sid->num_auths == 4 && sid_equal(get_global_sam_sid(), sid)) {
+               DOM_SID tmp_sid;
+               sid_copy(&tmp_sid, sid);
+               return map_domain_sid_to_name(&tmp_sid, dom_name) && 
+                       local_lookup_sid(sid, name, name_type);
+       }
+
        if (sid->num_auths == 5) {
                DOM_SID tmp_sid;
                uint32 rid;
index 74ac8fa865fe8194a8f03e67bd0a623b47a3109a..35317b9816481176ac6417cb4fa543676dda4e95 100644 (file)
@@ -742,6 +742,14 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
        GROUP_MAP map;
        BOOL ret;
 
+       if (sid_equal(get_global_sam_sid(), sid)) {
+               *psid_name_use = SID_NAME_DOMAIN;
+               fstrcpy(name, "");
+               DEBUG(5,("local_lookup_sid: SID is our own domain-sid: %s.\n", 
+                       sid_string_static(sid)));
+               return True;
+       }
+
        if (!sid_peek_check_rid(get_global_sam_sid(), sid, &rid)){
                DEBUG(0,("local_lookup_sid: sid_peek_check_rid return False! SID: %s\n",
                        sid_string_static(&map.sid)));
index 6c3157d5c95ba1d30f7ee5731bc9962792fff63d..498b83a4c9439693b81674ce0c2b0422418c6862 100644 (file)
@@ -281,8 +281,8 @@ static void init_lsa_trans_names(TALLOC_CTX *ctx, DOM_R_REF *ref, LSA_TRANS_NAME
                        }
                        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 ));
+                       DEBUG(10,("init_lsa_trans_names: added %s '%s\\%s' (%d) to referenced list.\n", 
+                               sid_type_lookup(sid_name_use), dom_name, name, sid_name_use ));
 
                }