postgresql/src/interfaces
Michael Paquier 861af92610 libpq: Improve error handling in passwordFromFile()
Previously, passwordFromFile() returned NULL for valid cases (like no
matching password found) and actual errors (two out-of-memory paths).
This made it impossible for its sole caller, pqConnectOptions2(), to
distinguish between these scenarios and fail the connection
appropriately should an out-of-memory error occur.

This patch extends passwordFromFile() to be able to detect both valid
and failure cases, with an error string given back to the caller of the
function.

Out-of-memory failures unlikely happen in the field, so no backpatch is
done.

Author: Joshua Shanks <jjshanks@gmail.com>
Discussion: https://postgr.es/m/CAOxqWDfihFRmhNVdfu8epYTXQRxkCHSOrg+=-ij2c_X3gW=o3g@mail.gmail.com
2025-11-04 20:12:48 +09:00
..
ecpg ecpg: check return value of replace_variables() 2025-10-17 10:03:15 +02:00
libpq libpq: Improve error handling in passwordFromFile() 2025-11-04 20:12:48 +09:00
libpq-oauth Fix .gitignore for src/interfaces/libpq-oauth. 2025-08-29 12:05:58 -04:00
Makefile oauth: Move the builtin flow into a separate module 2025-05-01 09:14:30 -07:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00