summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-05-06 21:36:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:51 -0500
commitc473d9e47f943a3c6b238127554bb475a014e80a (patch)
tree51b9f6ae094b0b0e138c6493172bdb7044776b48 /source3
parent78c27bb77000d6f97938e633e7be936c0de92636 (diff)
downloadsamba-c473d9e47f943a3c6b238127554bb475a014e80a.tar.gz
samba-c473d9e47f943a3c6b238127554bb475a014e80a.tar.bz2
samba-c473d9e47f943a3c6b238127554bb475a014e80a.zip
r22726: When performing an offline logon for a user in a trusted domain,
take care not to expire the name2sid cache entry just because that child does not know that the primary domain is offline. (This used to be commit 0399f52a1cdbb1acf8d41afddf498529ff4923cf)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/winbindd_cache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index 5bb98b17da..ed0d4131f6 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -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;
}