Re: [Freeipa-devel] [PATCH 0163] Fix compiler warning for pk11helper module

2014-11-20 Thread David Kupka

On 11/13/2014 09:59 AM, Martin Basti wrote:

On 12/11/14 15:55, Martin Basti wrote:

Part of ticket: https://fedorahosted.org/freeipa/ticket/4657


And here is the patch, sorry :-)




___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Works for me, thanks, ACK.

--
David Kupka

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH 0163] Fix compiler warning for pk11helper module

2014-11-20 Thread Petr Viktorin

On 11/20/2014 04:31 PM, David Kupka wrote:

On 11/13/2014 09:59 AM, Martin Basti wrote:

On 12/11/14 15:55, Martin Basti wrote:

Part of ticket: https://fedorahosted.org/freeipa/ticket/4657


And here is the patch, sorry :-)



Works for me, thanks, ACK.



Pushed to:
master: 58737c7791b44d9d7cd011d3385bf66ea24d9830
ipa-4-1: b902ec294387eef29d07ab2ccff9ff17625aaa9c


--
PetrĀ³

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH 0163] Fix compiler warning for pk11helper module

2014-11-13 Thread Martin Basti

On 12/11/14 15:55, Martin Basti wrote:

Part of ticket: https://fedorahosted.org/freeipa/ticket/4657


And here is the patch, sorry :-)


--
Martin Basti

From 4e1c366543e4b70ebd79cb1d143eccdebb9a5b2d Mon Sep 17 00:00:00 2001
From: Martin Basti mba...@redhat.com
Date: Wed, 29 Oct 2014 14:45:45 +0100
Subject: [PATCH] Fix pk11helper module compiler warnings

Ticket: https://fedorahosted.org/freeipa/ticket/4657
---
 ipapython/ipap11helper/library.c   | 10 +++---
 ipapython/ipap11helper/library.h   |  2 +-
 ipapython/ipap11helper/p11helper.c |  3 ++-
 ipapython/ipap11helper/setup.py|  1 -
 4 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/ipapython/ipap11helper/library.c b/ipapython/ipap11helper/library.c
index 51e24ebc2be5953a6820b768e75a3e8ccb026a64..fc4c1e41c9b3d3eb5ac5a0af7895bdf6a173a79e 100644
--- a/ipapython/ipap11helper/library.c
+++ b/ipapython/ipap11helper/library.c
@@ -44,7 +44,7 @@
 #include dlfcn.h
 
 // Load the PKCS#11 library
-CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle)
+CK_C_GetFunctionList loadLibrary(const char* module, void** moduleHandle)
 {
 	CK_C_GetFunctionList pGetFunctionList = NULL;
 
@@ -54,13 +54,9 @@ CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle)
 	if (module)
 	{
 		pDynLib = dlopen(module, RTLD_NOW | RTLD_LOCAL);
+	} else {
+		return NULL;
 	}
-	/*
-	else
-	{
-		pDynLib = dlopen(DEFAULT_PKCS11_LIB, RTLD_NOW | RTLD_LOCAL);
-	}
-	*/
 
 	if (pDynLib == NULL)
 	{
diff --git a/ipapython/ipap11helper/library.h b/ipapython/ipap11helper/library.h
index 2ceb9e375b457be298d683d784481326fd878c7f..afcbd9fd2e43106cd5592ba8a91b1da337452388 100644
--- a/ipapython/ipap11helper/library.h
+++ b/ipapython/ipap11helper/library.h
@@ -42,7 +42,7 @@
 
 #include p11-kit/pkcs11.h
 
-CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle);
+CK_C_GetFunctionList loadLibrary(const char* module, void** moduleHandle);
 void unloadLibrary(void* moduleHandle);
 
 #endif // !_SOFTHSM_V2_BIN_LIBRARY_H
diff --git a/ipapython/ipap11helper/p11helper.c b/ipapython/ipap11helper/p11helper.c
index 038c26c4520cc8f71edbee15b0ccd9bf292d7588..c1d100772e03660aeee831c76c1db96b6af49d76 100644
--- a/ipapython/ipap11helper/p11helper.c
+++ b/ipapython/ipap11helper/p11helper.c
@@ -1659,10 +1659,11 @@ P11_Helper_set_attribute(P11_Helper* self, PyObject *args, PyObject *kwds) {
 goto final;
 }
 if (PyString_AsStringAndSize(value, (char **) attribute.pValue,
-attribute.ulValueLen) == -1) {
+len) == -1) {
 ret = NULL;
 goto final;
 }
+attribute.ulValueLen = len;
 break;
 case CKA_LABEL:
 if (!PyUnicode_Check(value)) {
diff --git a/ipapython/ipap11helper/setup.py b/ipapython/ipap11helper/setup.py
index 338cdcb2ebf30fe6b0b29d7b11ac03f0a14cbe3c..e8e824a3386db7653b33d539a05927b8de9f029d 100644
--- a/ipapython/ipap11helper/setup.py
+++ b/ipapython/ipap11helper/setup.py
@@ -23,7 +23,6 @@ module = Extension('_ipap11helper',
'-ggdb3',
'-O2',
'-W',
-   '-pedantic',
'-Wall',
'-Wno-unused-parameter',
'-Wbad-function-cast',
-- 
1.8.3.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] [PATCH 0163] Fix compiler warning for pk11helper module

2014-11-12 Thread Martin Basti

Part of ticket: https://fedorahosted.org/freeipa/ticket/4657

--
Martin Basti

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel