pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jan.sarenik@generali.cz
To: pgsql-bugs@postgresql.org
Subject: BUG #9818: LDAP Authentication subtree problem
Date: Tue, 01 Apr 2014 14:19:07 +0000
Message-ID: <20140401141907.363.53665@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      9818
Logged by:          Ján Sáreník
Email address:      jan.sarenik@generali.cz
PostgreSQL version: Unsupported/Unknown
Operating system:   CentOS 6.5
Description:        

Hello!

Following line is my only record in pg_hba.conf:
local    all             all              ldap
ldapurl="ldap://aa00aaa001.aaaa.corp.local/DC=aaaa,DC=corp,DC=local?sAMAccountName?sub"
ldapbinddn="CN=svcLDAPDWH,OU=Services,OU=UsersAdm,DC=aaaa,DC=corp,DC=local"
ldapbindpasswd="XXXXXX"

LDAP server is Microsoft Active Directory.
I am testing on 554bb3beba27bf4a49edecc40f6c0f249974bc7c (today's git tree)
Version of OpenLDAP does not influence it (I have linked it with current
release, no change).
All I want in the end is to log into postgres as both of following users

CN=A000001,OU=UsersW7,DC=gpcz,DC=corp,DC=local
CN=A000002,OU=UsersStd,DC=gpcz,DC=corp,DC=local

Instead all I am getting is:
LOG:  could not search LDAP for filter "(CN=A000001)" on server
"aa00aaa001.aaaa.corp.local": Operations error
LOG:  could not search LDAP for filter "(CN=A000002)" on server
"aa00aaa001.aaaa.corp.local": Operations error

If I specify ldapurl to contain OU=UsersW7, I can log in as A000001
but not A000002 (and vice versa).

The only work around I was able to do so far is following, based
on the idea that LDAP_OPERATIONS_ERROR produced by MS AD server
is misleading. See end of
http://msdn.microsoft.com/en-us/library/dd303696.aspx

Thanks,
Ján

inline patch 1: src/backend/libpq/auth.c (+1/-1 lines) download inline-1.patchdiff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index 31ade0b..75255dd 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -2007,7 +2007,7 @@ CheckLDAPAuth(Port *port) 0, &search_message); - if (r != LDAP_SUCCESS) + if (r != LDAP_SUCCESS && r != LDAP_OPERATIONS_ERROR) { ereport(LOG, (errmsg("could not search LDAP for filter \"%s\" on
server \"%s\": %s", -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs

view thread (4+ messages)  latest in thread

Message-ID: <20140401141907.363.53665@wrigleys.postgresql.org>
Permalink:  ../20140401141907.363.53665@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140401141907.363.53665@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: jan.sarenik@generali.cz
  Subject: Re: BUG #9818: LDAP Authentication subtree problem
  In-Reply-To: <20140401141907.363.53665@wrigleys.postgresql.org>
  References: <20140401141907.363.53665@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