Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYj02-0003yN-3K for pgsql-bugs@postgresql.org; Wed, 14 Nov 2012 19:51:50 +0000 Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYizz-0002ZX-Lx for pgsql-bugs@postgresql.org; Wed, 14 Nov 2012 19:51:49 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TYizy-0004fM-2y for pgsql-bugs@postgresql.org; Wed, 14 Nov 2012 19:51:46 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1TYizx-0000RZ-EU for pgsql-bugs@postgresql.org; Wed, 14 Nov 2012 19:51:45 +0000 Date: Wed, 14 Nov 2012 19:51:45 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #7659: LDAP auth does not search the subtree To: pgsql-bugs@postgresql.org From: kevin@rootsmith.ca X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201211/86 X-Sequence-Number: 34644 The following bug has been logged on the website: Bug reference: 7659 Logged by: Kevin Smith Email address: kevin@rootsmith.ca PostgreSQL version: 9.2.1 Operating system: CentOS5 Description: = I have the following in my pg_hba.conf file: host all +ldap 127.0.0.1/32 ldap ldapserver=3D ldapport=3D389 ldapbasedb=3D"" ldapbinddn=3D"" ldapbindpasswd=3D ldapsearchattribute=3D If I try to connect from the localhost with a valid ldap account, it fails. Note that the is located in objects, one level deeper than the given. The error in the log is as follows: could not search LDAP for filter "(=3D)" on server "": error code 1 However, when I do the following on the command line, it works: ldapsearch -x -L -b "" -D "" -w -H ldap://:389 "(=3Dmy_user)" When I change the configuration in pg_hba.conf so that the ldapbasedn is exactly on the same level as where the user resides, it works perfectly. The documentation states "The search will be performed over the subtree at ldapbasedn" but this does not appear to be the case from my testing. The scope appears to be defaulting to be just searching the base.