Commit 5b406779 authored by Magnus Hagander's avatar Magnus Hagander

Treat ENOTDIR as ENOENT when looking for client certificate file

This makes it possible to use a libpq app with home directory set
to /dev/null, for example - treating it the same as if the file
doesn't exist (which it doesn't).

Per bug #6302, reported by Diego Elio Petteno
parent 155e56bd
...@@ -1013,7 +1013,7 @@ initialize_SSL(PGconn *conn) ...@@ -1013,7 +1013,7 @@ initialize_SSL(PGconn *conn)
* might or might not accept the connection. Any other error, * might or might not accept the connection. Any other error,
* however, is grounds for complaint. * however, is grounds for complaint.
*/ */
if (errno != ENOENT) if (errno != ENOENT && errno != ENOTDIR)
{ {
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("could not open certificate file \"%s\": %s\n"), libpq_gettext("could not open certificate file \"%s\": %s\n"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment