[patch] HEAD winbindd_cm.c mutex bug

Martin Pool mbp at samba.org
Fri Jan 10 05:00:02 GMT 2003


This patch is meant to fix the case where we repeatedly fail to
acquire the mutex for opening the connection.  At the moment the code
proceeds with neither the new_conn-> or result variables initialized,
which I'm pretty sure is a bug.

I don't know if this is the most appropriate status code but it should
be set to something.


--- winbindd_cm.c.~1.59.~	2003-01-09 12:11:32.000000000 +1100
+++ winbindd_cm.c	2003-01-10 15:55:53.000000000 +1100
@@ -369,9 +369,11 @@ static NTSTATUS cm_open_connection(const
 	      new_conn->controller, global_myname(), ipc_domain, ipc_username));
 
 	for (i = 0; retry && (i < 3); i++) {
-		
 		if (!secrets_named_mutex(new_conn->controller, 10)) {
 			DEBUG(0,("cm_open_connection: mutex grab failed for %s\n", new_conn->controller));
+			/* try again, but if we never succeed in getting a connection then this
+			 * is the result */
+			result = NT_STATUS_POSSIBLE_DEADLOCK;
 			continue;
 		}
 


-- 
Martin 



More information about the samba-technical mailing list