pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16399: Ldap authentication bug
2+ messages / 2 participants
[nested] [flat]

* BUG #16399: Ldap authentication bug
@ 2020-04-28 23:09  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2020-04-28 23:09 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: ciaranrh@gmail.com

The following bug has been logged on the website:

Bug reference:      16399
Logged by:          Ciaran
Email address:      ciaranrh@gmail.com
PostgreSQL version: 10.12
Operating system:   Windows Server 2012
Description:        

Hello,

Follow the documentation here:
https://www.postgresql.org/docs/10/auth-methods.html#AUTH-LDAP I'm
attempting to enable LDAP authentication on my postgres database. 

The relevant line for my testing this in my pg_hba.conf file is as
follows:
host 	all 		ciaranh 	0.0.0.0/0 		ldap
ldapurl="ldap://<DC>/OU=IT,DC=CNFLTD,DC=COM?sAMAccountName?one"
#ldapbinddn="CN=Postgres Bind, OU=Service Accounts, DC=CNFLTD, DC=COM"
ldapbindpasswd="cnfP@ssw0rd"

I receive the following error when trying to start the postgres service:
2020-04-28 16:00:02.619 PDT [4704] LOG:  authentication method "ldap"
requires argument "ldapserver" to be set
2020-04-28 16:00:02.619 PDT [4704] CONTEXT:  line 79 of configuration file
"C:/Program Files/PostgreSQL/10/data/pg_hba.conf"
2020-04-28 16:00:02.619 PDT [4704] FATAL:  could not load pg_hba.conf

I do not understand why the ldapserver need be set if it's specified in the
ldapurl field, this seems like a bug to me.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #16399: Ldap authentication bug
@ 2020-04-29 02:26  Thomas Munro <thomas.munro@gmail.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Munro @ 2020-04-29 02:26 UTC (permalink / raw)
  To: ciaranrh@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>

On Wed, Apr 29, 2020 at 12:22 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      16399
> Logged by:          Ciaran
> Email address:      ciaranrh@gmail.com
> PostgreSQL version: 10.12
> Operating system:   Windows Server 2012
> Description:
>
> Hello,
>
> Follow the documentation here:
> https://www.postgresql.org/docs/10/auth-methods.html#AUTH-LDAP I'm
> attempting to enable LDAP authentication on my postgres database.
>
> The relevant line for my testing this in my pg_hba.conf file is as
> follows:
> host    all             ciaranh         0.0.0.0/0               ldap
> ldapurl="ldap://<DC>/OU=IT,DC=CNFLTD,DC=COM?sAMAccountName?one"
> #ldapbinddn="CN=Postgres Bind, OU=Service Accounts, DC=CNFLTD, DC=COM"
> ldapbindpasswd="cnfP@ssw0rd"
>
> I receive the following error when trying to start the postgres service:
> 2020-04-28 16:00:02.619 PDT [4704] LOG:  authentication method "ldap"
> requires argument "ldapserver" to be set
> 2020-04-28 16:00:02.619 PDT [4704] CONTEXT:  line 79 of configuration file
> "C:/Program Files/PostgreSQL/10/data/pg_hba.conf"
> 2020-04-28 16:00:02.619 PDT [4704] FATAL:  could not load pg_hba.conf
>
> I do not understand why the ldapserver need be set if it's specified in the
> ldapurl field, this seems like a bug to me.

Huh.  I'm surprised you don't get the error "LDAP URLs not supported
on this platform"[1], since you're on Windows.  Our documentation
stays that we don't support LDAP URLs on Windows (patches welcome);
it's possible that the error checking for that is somehow wrong.

I haven't heard of this myself, but if your build is somehow using
OpenLDAP instead of Win32 LDAP then I suppose it should just work
(though I'm not entirely sure if there are other place in the code
that assume that Windows must be using Win32 LDAP).  That would imply
that ldap_url_parse() succeeded but set urldata->lud_host to NULL for
your input string.  Not sure why; when I tried passing that exact URL
to my local ldap_url_parse() it gives back the string "<DC>".  I don't
expect that to actually work (perhaps Windows LDAP understands "<DC>"
here, but I don't think OpenLDAP does) but that's another problem.

[1] https://github.com/postgres/postgres/blob/REL_10_STABLE/src/backend/libpq/hba.c#L1746





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-04-29 02:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 23:09 BUG #16399: Ldap authentication bug PG Bug reporting form <noreply@postgresql.org>
2020-04-29 02:26 ` Thomas Munro <thomas.munro@gmail.com>

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