pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix handling of HBA ldapserver with multiple hostnames.
7+ messages / 3 participants
[nested] [flat]

* pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 04:50  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Thomas Munro @ 2018-11-13 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of HBA ldapserver with multiple hostnames.

Commit 35c0754f failed to handle space-separated lists of alternative
hostnames in ldapserver, when building a URI for ldap_initialize()
(OpenLDAP).  Such lists need to be expanded to space-separated URIs.

Repair.  Back-patch to 11, to fix bug report #15495.

Author: Thomas Munro
Reported-by: Renaud Navarro
Discussion: https://postgr.es/m/15495-2c39fc196c95cd72%40postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/257ef3cd4fec7ca1213f31b660486b492b1c7031

Modified Files
--------------
src/backend/libpq/auth.c    | 42 +++++++++++++++++++++++++++++++++++++-----
src/test/ldap/t/001_auth.pl | 18 +++++++++++++++++-
2 files changed, 54 insertions(+), 6 deletions(-)



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

* pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 04:50  Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Munro @ 2018-11-13 04:50 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of HBA ldapserver with multiple hostnames.

Commit 35c0754f failed to handle space-separated lists of alternative
hostnames in ldapserver, when building a URI for ldap_initialize()
(OpenLDAP).  Such lists need to be expanded to space-separated URIs.

Repair.  Back-patch to 11, to fix bug report #15495.

Author: Thomas Munro
Reported-by: Renaud Navarro
Discussion: https://postgr.es/m/15495-2c39fc196c95cd72%40postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6b6c64a96dea5492448aa98cf24eca9325e80371

Modified Files
--------------
src/backend/libpq/auth.c    | 42 +++++++++++++++++++++++++++++++++++++-----
src/test/ldap/t/001_auth.pl | 18 +++++++++++++++++-
2 files changed, 54 insertions(+), 6 deletions(-)



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

* Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 05:37  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thomas Munro <tmunro@postgresql.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2018-11-13 05:37 UTC (permalink / raw)
  To: Thomas Munro <tmunro@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Thomas Munro <tmunro@postgresql.org> writes:
> Fix handling of HBA ldapserver with multiple hostnames.

longfin thinks this has a problem with const-ness:

auth.c:2380:10: error: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                        pfree(hostname);
                              ^~~~~~~~

			regards, tom lane




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

* Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 05:44  Thomas Munro <thomas.munro@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Thomas Munro @ 2018-11-13 05:44 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Thomas Munro <tmunro@postgresql.org>; pgsql-committers@lists.postgresql.org

On Tue, Nov 13, 2018 at 6:37 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <tmunro@postgresql.org> writes:
> > Fix handling of HBA ldapserver with multiple hostnames.
>
> longfin thinks this has a problem with const-ness:
>
> auth.c:2380:10: error: passing 'const char *' to parameter of type 'void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
>                         pfree(hostname);
>                               ^~~~~~~~

Thanks, fixing.  Embarassingly, I had turned off -Werror for this
because my Mac spews strange warnings when you use OpenLDAP, a problem
to which there must be a better solution.

-- 
Thomas Munro
http://www.enterprisedb.com




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

* Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 05:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thomas Munro <thomas.munro@enterprisedb.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Tom Lane @ 2018-11-13 05:54 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org

Thomas Munro <thomas.munro@enterprisedb.com> writes:
> Thanks, fixing.  Embarassingly, I had turned off -Werror for this
> because my Mac spews strange warnings when you use OpenLDAP, a problem
> to which there must be a better solution.

Hm, what warnings?

			regards, tom lane




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

* Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 05:58  Thomas Munro <thomas.munro@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 7+ messages in thread

From: Thomas Munro @ 2018-11-13 05:58 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On Tue, Nov 13, 2018 at 6:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
> > Thanks, fixing.  Embarassingly, I had turned off -Werror for this
> > because my Mac spews strange warnings when you use OpenLDAP, a problem
> > to which there must be a better solution.
>
> Hm, what warnings?

Apple ships OpenLDAP headers that tell you to ditch it and use Apple
OpenDirectory Framework:

fe-connect.c:4354:6: warning: 'ldap_set_option' is deprecated: first
deprecated in macOS 10.11 - use OpenDirectory Framework
[-Wdeprecated-declarations]

I should probably use MacPorts for that.

-- 
Thomas Munro
http://www.enterprisedb.com




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

* Re: pgsql: Fix handling of HBA ldapserver with multiple hostnames.
@ 2018-11-13 14:39  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thomas Munro <thomas.munro@enterprisedb.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-11-13 14:39 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org

Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Tue, Nov 13, 2018 at 6:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Hm, what warnings?

> Apple ships OpenLDAP headers that tell you to ditch it and use Apple
> OpenDirectory Framework:

Oh, that.  I just use -Wno-deprecated-declarations.

A bigger issue to my mind is that configure bleats about the
OpenLDAP version:

checking for compatible LDAP implementation... (cached) no
configure: WARNING:
*** With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, each backend
*** process that loads libpq (via WAL receiver, dblink, or postgres_fdw) and
*** also uses LDAP will crash on exit.

I have not experimented to see if that's really true on recent macOS,
but if it is, it'd be a problem for production use.

			regards, tom lane




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


end of thread, other threads:[~2018-11-13 14:39 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 04:50 pgsql: Fix handling of HBA ldapserver with multiple hostnames. Thomas Munro <tmunro@postgresql.org>
2018-11-13 05:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-11-13 05:44   ` Thomas Munro <thomas.munro@enterprisedb.com>
2018-11-13 05:54     ` Tom Lane <tgl@sss.pgh.pa.us>
2018-11-13 05:58       ` Thomas Munro <thomas.munro@enterprisedb.com>
2018-11-13 14:39         ` Tom Lane <tgl@sss.pgh.pa.us>
2018-11-13 04:50 pgsql: Fix handling of HBA ldapserver with multiple hostnames. Thomas Munro <tmunro@postgresql.org>

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