summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-05-23 21:46:45 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-06-19 14:09:45 +0200
commite3a3c7360841821b7c7becd0b4f05d93e1535b05 (patch)
treedff915695d391b1ea6b9c454c5769a10ca2b2b62
parentceb393ad6d7ecc41dd9f15b64dd7d94db43a8582 (diff)
downloadsssd-sssd-1-11.zip
sssd-sssd-1-11.tar.gz
sssd-sssd-1-11.tar.xz
pysss_nss_idmap: Use wrapper for older pythonsssd-1-11
PyUnicode_FromString -> sss_python_unicode_from_string
-rw-r--r--Makefile.am3
-rw-r--r--src/python/pysss_nss_idmap.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 9d972f9..3f0f0c0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2181,7 +2181,8 @@ pysss_murmur_la_LDFLAGS = \
-module
pysss_nss_idmap_la_SOURCES = \
- src/python/pysss_nss_idmap.c
+ src/python/pysss_nss_idmap.c \
+ src/util/sss_python.c
pysss_nss_idmap_la_CFLAGS = \
$(AM_CFLAGS) \
$(PYTHON_CFLAGS)
diff --git a/src/python/pysss_nss_idmap.c b/src/python/pysss_nss_idmap.c
index 0870b0d..ad4b4a3 100644
--- a/src/python/pysss_nss_idmap.c
+++ b/src/python/pysss_nss_idmap.c
@@ -95,7 +95,7 @@ static int do_getsidbyname(PyObject *py_result, PyObject *py_name)
ret = sss_nss_getsidbyname(name, &sid, &id_type);
if (ret == 0) {
ret = add_dict(py_result, py_name, PyString_FromString(SSS_SID_KEY),
- PyUnicode_FromString(sid), PyInt_FromLong(id_type));
+ sss_python_unicode_from_string(sid), PyInt_FromLong(id_type));
}
free(sid);
@@ -117,7 +117,7 @@ static int do_getnamebysid(PyObject *py_result, PyObject *py_sid)
ret = sss_nss_getnamebysid(sid, &name, &id_type);
if (ret == 0) {
ret = add_dict(py_result, py_sid, PyString_FromString(SSS_NAME_KEY),
- PyUnicode_FromString(name), PyInt_FromLong(id_type));
+ sss_python_unicode_from_string(name), PyInt_FromLong(id_type));
}
free(name);
@@ -156,7 +156,7 @@ static int do_getsidbyid(PyObject *py_result, PyObject *py_id)
ret = sss_nss_getsidbyid((uint32_t) id, &sid, &id_type);
if (ret == 0) {
ret = add_dict(py_result, py_id, PyString_FromString(SSS_SID_KEY),
- PyUnicode_FromString(sid), PyInt_FromLong(id_type));
+ sss_python_unicode_from_string(sid), PyInt_FromLong(id_type));
}
free(sid);