From ee82d2f519cc97aa433cf050b6c96d3430aa5a61 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Mon, 19 Jan 2015 23:08:59 +0100 Subject: Allow configuration of NSS and PAM names This introduces the --with-module-name configure option to allow building of NSS and PAM modules with different namespaces than ldap. --- pynslcd/constants.py.in | 5 ++++- pynslcd/pynslcd.py | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'pynslcd') diff --git a/pynslcd/constants.py.in b/pynslcd/constants.py.in index 4f57e34..e5972f8 100644 --- a/pynslcd/constants.py.in +++ b/pynslcd/constants.py.in @@ -2,7 +2,7 @@ # constants.py - configured information and constants, this file is processed # and extended by the configure script # -# Copyright (C) 2012 Arthur de Jong +# Copyright (C) 2012-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -49,3 +49,6 @@ NSLCD_SOCKET = '''@NSLCD_SOCKET@''' # The SONAME of the NSS library module. NSS_LDAP_SONAME = '''@NSS_LDAP_SONAME@''' + +# The name of the NSS and PAM modules. +MODULE_NAME = '''@MODULE_NAME@''' diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py index 27b31d8..bf6b31f 100755 --- a/pynslcd/pynslcd.py +++ b/pynslcd/pynslcd.py @@ -2,7 +2,7 @@ # pynslcd.py - main daemon module # -# Copyright (C) 2010-2014 Arthur de Jong +# Copyright (C) 2010-2015 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -91,7 +91,7 @@ def display_version(fp): fp.write('%(PACKAGE_STRING)s\n' 'Written by Arthur de Jong.\n' '\n' - 'Copyright (C) 2010-2014 Arthur de Jong\n' + 'Copyright (C) 2010-2015 Arthur de Jong\n' 'This is free software; see the source for copying conditions. There is NO\n' 'warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n' % {'PACKAGE_STRING': constants.PACKAGE_STRING, }) @@ -242,7 +242,8 @@ def disable_nss_ldap(): except OSError: return # ignore errors in opening NSS module try: - ctypes.c_int.in_dll(lib, '_nss_ldap_enablelookups').value = 0 + ctypes.c_int.in_dll( + lib, '_nss_%s_enablelookups' % constants.MODULE_NAME).value = 0 except ValueError: logging.warn('probably older NSS module loaded', exc_info=True) try: -- cgit v1.2.3