From 546a0d80e9e6096eb766c966e7cedf6d51502c86 Mon Sep 17 00:00:00 2001
From: Fredrik Thulin <fredrik@thulin.net>
Date: Mon, 28 Jan 2013 17:01:36 +0100
Subject: [PATCH] Don't try to unlink() non-UNIX socket paths.

---
 gck-rpc-dispatch.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gck-rpc-dispatch.c b/gck-rpc-dispatch.c
index dfdf33e..c303db6 100644
--- a/gck-rpc-dispatch.c
+++ b/gck-rpc-dispatch.c
@@ -2601,7 +2601,9 @@ void gck_rpc_layer_uninitialize(void)
 	pkcs11_socket = -1;
 
 	/* Delete our unix socket */
-	if (pkcs11_socket_path[0])
+	if (pkcs11_socket_path[0] &&
+	    strncmp(pkcs11_socket_path, "tcp://", strlen("tcp://")) != 0 &&
+	    strncmp(pkcs11_socket_path, "tls://", strlen("tls://")) != 0)
 		unlink(pkcs11_socket_path);
 	pkcs11_socket_path[0] = 0;
 
-- 
GitLab