svn commit: samba r22726 - in branches: SAMBA_3_0/source/nsswitch
SAMBA_3_0_26/source/nsswitch
jerry at samba.org
jerry at samba.org
Sun May 6 21:36:20 GMT 2007
Author: jerry
Date: 2007-05-06 21:36:20 +0000 (Sun, 06 May 2007)
New Revision: 22726
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22726
Log:
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.
Modified:
branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c
Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-05-06 21:34:24 UTC (rev 22725)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-05-06 21:36:20 UTC (rev 22726)
@@ -2448,6 +2448,7 @@
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 @@
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;
}
Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-05-06 21:34:24 UTC (rev 22725)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_cache.c 2007-05-06 21:36:20 UTC (rev 22726)
@@ -2426,6 +2426,7 @@
struct cache_entry *centry = NULL;
NTSTATUS status;
fstring uname;
+ BOOL original_online_state;
domain = find_lookup_domain_from_name(domain_name);
if (domain == NULL) {
@@ -2441,7 +2442,14 @@
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;
}
More information about the samba-cvs
mailing list