Re: [COMMITTERS] pgsql: Add API functions to libpq to interrogate SSL related stuff.

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add API functions to libpq to interrogate SSL related stuff.
Date: 2015-02-04 07:35:17
Message-ID: 54D1CBB5.6030300@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 02/04/2015 02:23 AM, Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> writes:
>> Add API functions to libpq to interrogate SSL related stuff.
>
> This patch is one large brick shy of a load: it creates exported libpq
> functions but fails to ensure they always exist. That's why jacana is
> unhappy; though TBH I'm astonished that any non-ssl-enabled builds
> are passing. Apparently missing library functions are less of a hard
> error on Linux than they ought to be.

Yeah, that's surprising. I don't see any option in ld man page to make
it warn either.

This also shows that we don't have any regression tests for this
function. It's trivial, so I'm not worried about that, but in general it
would be good to have a regression tests suite specifically for libpq.
There are probably many other things that are not exercised by psql.

> I think probably the exported functions need to be defined in fe-exec.c
> or fe-connect.c, with bodies along the lines of
>
> #ifdef USE_OPENSSL
> call OpenSSL-specific function
> #else
> return NULL
> #endif
>
> (or whatever's appropriate when no SSL support). We do want these
> functions to exist even in non-SSL-enabled builds.

Sure. There are dummy versions of all the other SSL-related functions, I
just missed PQsslAttributes. The OpenSSL-versions are in
fe-secure-openssl.c, and the dummy ones are in fe-secure.c, within a
"#ifndef USE_SSL" block.

Fixed now.

- Heikki

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2015-02-04 10:01:13 pgsql: doc: Fix markup
Previous Message Heikki Linnakangas 2015-02-04 07:13:27 pgsql: Add dummy PQsslAttributes function for non-SSL builds.

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2015-02-04 07:58:15 Re: pg_basebackup may fail to send feedbacks.
Previous Message Jim Nasby 2015-02-04 05:55:04 Re: Fetch zero result rows when executing a query?