]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix sslkeylogfile error handling logging
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 10 Jul 2025 21:26:51 +0000 (23:26 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 10 Jul 2025 21:26:51 +0000 (23:26 +0200)
commit39f01083facd0ddc0040662a71159e9987813c2c
tree8fa04408a5847c670263afdf8e4a27eb63417ebe
parent36026b0fe3abb33f49477f2474e1f7b3f0fdf3d2
Fix sslkeylogfile error handling logging

When sslkeylogfile has been set but the file fails to open in an
otherwise successful connection, the log entry added to the conn
object is never printed.  Instead print the error on stderr for
increased visibility.  This is a debugging tool so using stderr
for logging is appropriate.  Also while there, remove the umask
call in the callback as it's not useful.

Issues noted by Peter Eisentraut in post-commit review, backpatch
down to 18 when support for sslkeylogfile was added

Author: Daniel Gustafsson <daniel@yesql.se>
Reported-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/70450bee-cfaa-48ce-8980-fc7efcfebb03@eisentraut.org
Backpatch-through: 18
src/interfaces/libpq/fe-secure-openssl.c
src/test/ssl/t/001_ssltests.pl