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

gd at samba.org gd at samba.org
Sun Dec 18 22:45:57 GMT 2005


Author: gd
Date: 2005-12-18 22:45:56 +0000 (Sun, 18 Dec 2005)
New Revision: 12326

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

Log:
Remove the DE/DR records from the winbind cache when the response is
read from the tdb.

Volker, please verify.

Guenther

Modified:
   trunk/source/nsswitch/winbindd_cache.c
   trunk/source/nsswitch/winbindd_dual.c


Changeset:
Modified: trunk/source/nsswitch/winbindd_cache.c
===================================================================
--- trunk/source/nsswitch/winbindd_cache.c	2005-12-18 22:28:41 UTC (rev 12325)
+++ trunk/source/nsswitch/winbindd_cache.c	2005-12-18 22:45:56 UTC (rev 12326)
@@ -1735,6 +1735,25 @@
 	return True;
 }
 
+void cache_cleanup_response(pid_t pid)
+{
+	fstring key_str;
+
+	if (!init_wcache())
+		return;
+
+	DEBUG(10,("Cleaning up response for pid %d\n", pid));
+
+	fstr_sprintf(key_str, "DR/%d", pid);
+	tdb_delete(wcache->tdb, string_tdb_data(key_str));
+
+	fstr_sprintf(key_str, "DE/%d", pid);
+	tdb_delete(wcache->tdb, string_tdb_data(key_str));
+
+	return;
+}
+
+
 BOOL lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
 		       const char **domain_name, const char **name,
 		       enum SID_NAME_USE *type)

Modified: trunk/source/nsswitch/winbindd_dual.c
===================================================================
--- trunk/source/nsswitch/winbindd_dual.c	2005-12-18 22:28:41 UTC (rev 12325)
+++ trunk/source/nsswitch/winbindd_dual.c	2005-12-18 22:45:56 UTC (rev 12326)
@@ -197,6 +197,8 @@
 	SMB_ASSERT(cache_retrieve_response(child->pid,
 					   state->response));
 
+	cache_cleanup_response(child->pid);
+	
 	DLIST_REMOVE(child->requests, state);
 
 	schedule_async_request(child);



More information about the samba-cvs mailing list