pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kevin@rootsmith.ca
To: pgsql-bugs@postgresql.org
Subject: BUG #7659: LDAP auth does not search the subtree
Date: Wed, 14 Nov 2012 19:51:45 +0000
Message-ID: <E1TYizx-0000RZ-EU@wrigleys.postgresql.org> (raw)

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=<myserver> ldapport=389
ldapbasedb="<my base dn>" ldapbinddn="<my bind dn>" ldapbindpasswd=<passwd>
ldapsearchattribute=<search_attr>

If I try to connect from the localhost with a valid ldap account, it fails.
Note that the <search_attr> is located in objects, one level deeper than the
<my base dn> given.

The error in the log is as follows:

could not search LDAP for filter "(<search_attr>=<my_user>)" on server
"<myserver>": error code 1

However, when I do the following on the command line, it works:

ldapsearch -x -L -b "<my base dn>" -D "<my bind dn>" -w <passwd> -H
ldap://<myserver>:389 "(<search_attr>=my_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.





view thread (3+ messages)  latest in thread

Message-ID: <E1TYizx-0000RZ-EU@wrigleys.postgresql.org>
Permalink:  ../E1TYizx-0000RZ-EU@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1TYizx-0000RZ-EU@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kevin@rootsmith.ca
  Subject: Re: BUG #7659: LDAP auth does not search the subtree
  In-Reply-To: <E1TYizx-0000RZ-EU@wrigleys.postgresql.org>
  References: <E1TYizx-0000RZ-EU@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox