From 97d35f32806b54160767269da9a538b1cebd23db Mon Sep 17 00:00:00 2001
From: Arthur de Jong <arthur@arthurdejong.org>
Date: Fri, 10 May 2013 23:56:44 +0200
Subject: Ignore errors in opening NSS module

---
 pynslcd/pynslcd.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py
index 99bfda8..df54bad 100755
--- a/pynslcd/pynslcd.py
+++ b/pynslcd/pynslcd.py
@@ -229,7 +229,10 @@ def acceptconnection(session):
 def disable_nss_ldap():
     """Disable the nss_ldap module to avoid lookup loops."""
     import ctypes
-    lib = ctypes.CDLL(constants.NSS_LDAP_SONAME)
+    try:
+        lib = ctypes.CDLL(constants.NSS_LDAP_SONAME)
+    except OSError:
+        return  # ignore errors in opening NSS module
     try:
         ctypes.c_int.in_dll(lib, '_nss_ldap_enablelookups').value = 0
     except ValueError:
-- 
cgit v1.2.3