Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pynslcd
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2015-01-19 23:08:59 +0100
committerArthur de Jong <arthur@arthurdejong.org>2015-01-19 23:09:45 +0100
commitee82d2f519cc97aa433cf050b6c96d3430aa5a61 (patch)
treef95189a2fa6a9f018ddcd6b1fbb72721f5c24b0c /pynslcd
parented8b312f0968ce4fd9059b0ebb52d993cf3cdf36 (diff)
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.
Diffstat (limited to 'pynslcd')
-rw-r--r--pynslcd/constants.py.in5
-rwxr-xr-xpynslcd/pynslcd.py7
2 files changed, 8 insertions, 4 deletions
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: