Clean up dead control sockets.

David Woodhouse dwmw2 at infradead.org
Mon Sep 5 19:02:24 EST 2005


With 'ControlMaster auto' a stale socket will prevent ssh from being
able to connect. It'll try to use the socket, fail, then connect for
itself... but will then abort when it can't create its own socket.

--- openssh-4.2p1/ssh.c~	2005-09-05 09:49:31.000000000 +0100
+++ openssh-4.2p1/ssh.c	2005-09-05 09:56:34.000000000 +0100
@@ -1247,7 +1247,11 @@ control_client(const char *path)
 		}
 		if (errno == ENOENT)
 	 		debug("Control socket \"%.100s\" does not exist", path);
-		else {
+		else if (errno == ECONNREFUSED) {
+	 		debug("Control socket connect(%.100s): %s", path,
+			    strerror(errno));
+			unlink(path);
+		} else {
 	 		error("Control socket connect(%.100s): %s", path,
 			    strerror(errno));
 		}

-- 
dwmw2





More information about the openssh-unix-dev mailing list