Re: pgsql: Add TAP tests for contrib/sslinfo - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Add TAP tests for contrib/sslinfo
Date
Msg-id 1632478.1638305700@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Add TAP tests for contrib/sslinfo  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: pgsql: Add TAP tests for contrib/sslinfo  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-committers
Daniel Gustafsson <daniel@yesql.se> writes:
> Scratch that, all the copying for tests 001 through 003 had failed.  I clearly
> need another coffee.
> The question still stands though, does anyone have any ideas on what could've
> happened as I'm currently drawing a blank?

Dunno, but it strikes me that the libpq code issuing this error is not up
to our usual quality standards.  It's just assuming that the stat()
failure is ENOENT, and I have a sneaking suspicion that that's not so.

I'm inclined to suggest that we start by changing that code
to look like, say,

        if (stat(fnbuf, &buf) != 0)
        {
            if (errno == ENOENT)
                appendPQExpBuffer(&conn->errorMessage,
                                  libpq_gettext("certificate present, but not private key file \"%s\"\n"),
                                  fnbuf);
            else
                appendPQExpBuffer(&conn->errorMessage,
                                  libpq_gettext("could not stat private key file \"%s\": %m\n"),
                                  fnbuf);
            return -1;
        }

and see what we learn.

            regards, tom lane



pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Update high level vacuumlazy.c comments.
Next
From: Daniel Gustafsson
Date:
Subject: Re: pgsql: Add TAP tests for contrib/sslinfo