svn commit: samba r13234 - in trunk/source/nsswitch: .

jra at samba.org jra at samba.org
Mon Jan 30 19:01:13 GMT 2006


Author: jra
Date: 2006-01-30 19:01:10 +0000 (Mon, 30 Jan 2006)
New Revision: 13234

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13234

Log:
Fix stupid bug where I was dereferencing the cache pointer
before it was initialized. Doh !
Jeremy.

Modified:
   trunk/source/nsswitch/winbindd_cache.c


Changeset:
Modified: trunk/source/nsswitch/winbindd_cache.c
===================================================================
--- trunk/source/nsswitch/winbindd_cache.c	2006-01-30 18:38:18 UTC (rev 13233)
+++ trunk/source/nsswitch/winbindd_cache.c	2006-01-30 19:01:10 UTC (rev 13234)
@@ -2255,6 +2255,14 @@
 
 	DEBUG(10,("set_global_winbindd_state_offline: offline requested.\n"));
 
+	/* Only go offline if someone has created
+	   the key "WINBINDD_OFFLINE" in the cache tdb. */
+
+	if (wcache == NULL || wcache->tdb == NULL) {
+		DEBUG(10,("set_global_winbindd_state_offline: wcache not open yet.\n"));
+		return False;
+	}
+
 	if (!lp_winbind_offline_logon()) {
 		DEBUG(10,("set_global_winbindd_state_offline: rejecting.\n"));
 		return False;
@@ -2265,13 +2273,6 @@
 		return True;
 	}
 
-	/* Only go offline if someone has created
-	   the key "WINBINDD_OFFLINE" in the cache tdb. */
-
-	if (!wcache->tdb) {
-		return False;
-	}
-
 	wcache->tdb->ecode = 0;
 
 	data = tdb_fetch_bystring( wcache->tdb, "WINBINDD_OFFLINE" );



More information about the samba-cvs mailing list