summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2014-10-29 14:45:45 +0100
committerPetr Viktorin <pviktori@dhcp-31-13.brq.redhat.com>2014-11-20 16:46:30 +0100
commit58737c7791b44d9d7cd011d3385bf66ea24d9830 (patch)
treea5a16839b65c1b3d3d3d2c6928ebf87e88a1ceb6 /ipapython
parenta3c799f2f4769c1ae8516600e3729a2188ca539f (diff)
downloadfreeipa-58737c7791b44d9d7cd011d3385bf66ea24d9830.tar.gz
freeipa-58737c7791b44d9d7cd011d3385bf66ea24d9830.tar.xz
freeipa-58737c7791b44d9d7cd011d3385bf66ea24d9830.zip
Fix pk11helper module compiler warnings
Ticket: https://fedorahosted.org/freeipa/ticket/4657 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipap11helper/library.c10
-rw-r--r--ipapython/ipap11helper/library.h2
-rw-r--r--ipapython/ipap11helper/p11helper.c3
-rw-r--r--ipapython/ipap11helper/setup.py1
4 files changed, 6 insertions, 10 deletions
diff --git a/ipapython/ipap11helper/library.c b/ipapython/ipap11helper/library.c
index 51e24ebc2..fc4c1e41c 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 2ceb9e375..afcbd9fd2 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 038c26c45..c1d100772 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 338cdcb2e..e8e824a33 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',