From 2c596749ba8c9b30ae355757b351d662a1371b5b Mon Sep 17 00:00:00 2001
From: Fredrik Thulin <fredrik@thulin.net>
Date: Thu, 17 Jan 2013 14:17:36 +0100
Subject: [PATCH] Ask p11 module to use OS locking.

Since p11proxy is a threaded application, the underlying p11
module should do locking (the proxy does no locking).
---
 gck-rpc-daemon-standalone.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gck-rpc-daemon-standalone.c b/gck-rpc-daemon-standalone.c
index ae10932..9b89f50 100644
--- a/gck-rpc-daemon-standalone.c
+++ b/gck-rpc-daemon-standalone.c
@@ -170,6 +170,7 @@ int main(int argc, char *argv[])
 	fd_set read_fds;
 	int sock, ret;
 	CK_RV rv;
+	CK_C_INITIALIZE_ARGS init_args;
 
 
         if (install_syscall_reporter())
@@ -212,7 +213,10 @@ int main(int argc, char *argv[])
 	}
 
 	/* RPC layer expects initialized module */
-	rv = (funcs->C_Initialize) (NULL /* &p11_init_args */);
+	memset(&init_args, 0, sizeof(init_args));
+	init_args.flags = CKF_OS_LOCKING_OK;
+
+	rv = (funcs->C_Initialize) (&init_args);
 	if (rv != CKR_OK) {
 		fprintf(stderr, "couldn't initialize module: %s: 0x%08x\n",
 			argv[1], (int)rv);
-- 
GitLab