From 85e30f2a743ab2ec2a2cccaa55c5cb9f692039b3 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 4 May 2012 20:10:48 +0000 Subject: ensure search also works without attribute map git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1681 ef36b2f9-881f-0410-afb5-c4e39611909c --- pynslcd/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pynslcd') diff --git a/pynslcd/common.py b/pynslcd/common.py index bded618..3ce0b12 100644 --- a/pynslcd/common.py +++ b/pynslcd/common.py @@ -63,6 +63,7 @@ class Search(object): case_insensitive - check that these attributes are present in the response if they were in the request limit_attributes - override response attributes with request attributes + (ensure that only one copy of the value is returned) required - attributes that are required canonical_first - search the DN for these attributes and ensure that they are listed first in the attribute values @@ -136,7 +137,8 @@ class Search(object): """Handle an entry with the specified attributes, filtering it with the request parameters where needed.""" # translate the attributes using the attribute mapping - attributes = self.attmap.translate(attributes) + if self.attmap: + attributes = self.attmap.translate(attributes) # make sure value from DN is first value for attr in self.canonical_first: primary_value = self.attmap.get_rdn_value(dn, attr) -- cgit v1.2.3