From 2b0578efa3ebc2b6710aa420b0647e7208f0e0ea Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 9 Aug 2016 13:50:24 +0200 Subject: [PATCH 1/2] intg: Make location of sssd nss module configurable The path to sssd nss module (libsss_nss.so) was relative to prefix and expected subdirectory "lib". 32bit and 64bit platforms and different distributions use different paths. This patch allows to use python module sssd_id even with real module and not just integration tests. It is just required to prepare "config.py" with right path. e.g. cd ~/sssd/src/tests/intg [~/sssd/src/tests/intg]$ echo "NSS_MODULE_DIR = '/usr/lib64'" > config.py [~/sssd/src/tests/intg]$ python Python 2.7.12 (default, Jul 18 2016, 09:57:01) [GCC 6.1.1 20160621 (Red Hat 6.1.1-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sssd_id >>> sssd_id.get_user_gids('user') (1, 0, [5977, 1070, 5845, 1076, 1074, 10327, 5975, 5766]) --- src/tests/intg/config.py.m4 | 1 + src/tests/intg/sssd_id.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/intg/config.py.m4 b/src/tests/intg/config.py.m4 index 563127c6ea895508308a4f94689cc4e26ca4cbde..77aa47b7958783217132b724159d9d3d247e1079 100644 --- a/src/tests/intg/config.py.m4 +++ b/src/tests/intg/config.py.m4 @@ -4,6 +4,7 @@ Build configuration variables. PREFIX = "prefix" SYSCONFDIR = "sysconfdir" +NSS_MODULE_DIR = PREFIX + "/lib" SSSDCONFDIR = SYSCONFDIR + "/sssd" CONF_PATH = SSSDCONFDIR + "/sssd.conf" DB_PATH = "dbpath" diff --git a/src/tests/intg/sssd_id.py b/src/tests/intg/sssd_id.py index 500f242ecc6c890a5683d8747ac0338555ce1709..4ae41af98bad804026083b193eddfa6c2d3c924c 100644 --- a/src/tests/intg/sssd_id.py +++ b/src/tests/intg/sssd_id.py @@ -45,7 +45,7 @@ def call_sssd_initgroups(user, gid): gids should contain user group IDs if err is NssReturnCode.SUCCESS otherwise errno will contain non-zero value. """ - libnss_sss_path = config.PREFIX + "/lib/libnss_sss.so.2" + libnss_sss_path = config.NSS_MODULE_DIR + "/libnss_sss.so.2" libnss_sss = cdll.LoadLibrary(libnss_sss_path) func = libnss_sss._nss_sss_initgroups_dyn -- 2.9.2