When performing an offline logon for a user in a trusted domain,
authorjerry <jerry@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Sun, 6 May 2007 21:36:20 +0000 (21:36 +0000)
committerjerry <jerry@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Sun, 6 May 2007 21:36:20 +0000 (21:36 +0000)
take care not to expire the name2sid cache entry just because
that child does not know that the primary domain is offline.

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@22726 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/nsswitch/winbindd_cache.c

index 5bb98b17da411901e2630ab9305bd9f3649ee74d..ed0d4131f618179f0157b6f2af8ec6d21063c41b 100644 (file)
@@ -2448,6 +2448,7 @@ BOOL lookup_cached_name(TALLOC_CTX *mem_ctx,
        struct cache_entry *centry = NULL;
        NTSTATUS status;
        fstring uname;
+       BOOL original_online_state;     
 
        domain = find_lookup_domain_from_name(domain_name);
        if (domain == NULL) {
@@ -2463,7 +2464,14 @@ BOOL lookup_cached_name(TALLOC_CTX *mem_ctx,
        fstrcpy(uname, name);
        strupper_m(uname);
        
+       /* If we are doing a cached logon, temporarily set the domain
+          offline so the cache won't expire the entry */
+       
+       original_online_state = domain->online;
+       domain->online = False;
        centry = wcache_fetch(cache, domain, "NS/%s/%s", domain_name, uname);
+       domain->online = original_online_state;
+       
        if (centry == NULL) {
                return False;
        }