[gnome-keyring] only print debug message if no pkcs11 socket



commit 370694b36f1ed6f26554ccc740da3b3e92aafded
Author: Rex Dieter <rdieter fedoraproject org>
Date:   Fri Aug 17 08:52:25 2012 -0500

    only print debug message if no pkcs11 socket
    
    This is to handle the case of running gnome-keyring in environments
    not matching GNOME;Unity and avoid needless
    WARNING: couldn't connect to: /tmp/keyring-SqfLpI/pkcs11
    type errors
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665961

 pkcs11/rpc-layer/gkm-rpc-module.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/pkcs11/rpc-layer/gkm-rpc-module.c b/pkcs11/rpc-layer/gkm-rpc-module.c
index 240fd83..1b11d96 100644
--- a/pkcs11/rpc-layer/gkm-rpc-module.c
+++ b/pkcs11/rpc-layer/gkm-rpc-module.c
@@ -251,8 +251,13 @@ call_connect (CallState *cs)
 
 	if (connect (sock, (struct sockaddr*) &addr, sizeof (addr)) < 0) {
 		close (sock);
-		warning (("couldn't connect to: %s: %s", pkcs11_socket_path, strerror (errno)));
-		return CKR_DEVICE_ERROR;
+		if (errno == ENOENT) {
+			debug (("couldn't connect to: %s: %s", pkcs11_socket_path, strerror (errno)));
+			return CKR_DEVICE_REMOVED;
+		} else {
+			warning (("couldn't connect to: %s: %s", pkcs11_socket_path, strerror (errno)));
+			return CKR_DEVICE_ERROR;
+		}
 	}
 
 	if (egg_unix_credentials_write (sock) < 0) {
@@ -1208,6 +1213,10 @@ rpc_C_Initialize (CK_VOID_PTR init_args)
 				if (ret == CKR_OK)
 					ret = call_run (cs);
 				call_done (cs, ret);
+
+			/* No daemon available */
+			} else if (ret == CKR_DEVICE_REMOVED) {
+				ret = CKR_OK;
 			}
 		}
 
@@ -1248,8 +1257,13 @@ rpc_C_Finalize (CK_VOID_PTR reserved)
 				if (ret == CKR_OK)
 					ret = call_run (cs);
 				call_done (cs, ret);
+
+			/* No daemon available */
+			} else if (ret == CKR_DEVICE_REMOVED) {
+				ret = CKR_OK;
 			}
 
+
 			if (ret != CKR_OK)
 				warning (("finalizing the daemon returned an error: %d", ret));
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]