Replace PostmasterRandom() with pg_strong_random().
authorTatsuo Ishii <ishii@postgresql.org>
Tue, 20 May 2025 00:47:02 +0000 (09:47 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 20 May 2025 00:47:02 +0000 (09:47 +0900)
commit7abdd48ece6630eb2c376e865d39500e49b33d8c
treee4716659090a3f2194db57da5aa5d62f6b37e7c4
parentbc0d9ca49d7afabcbfc8e000a40075a9fac1adf6
Replace PostmasterRandom() with pg_strong_random().

Our PostmasterRandmon() was imported from PostgreSQL long time ago (in
2016). In the same year PostgreSQL replaced PostmasterRandmon() with
pg_strong_random()(src/port/pg_strong_random.c). This commit follows
it.

pg_strong_random() looks better than PostmasterRandmon(), since it's
more secure and portable. Moreover no initialization is necessary.

Reviewed-by: Martijn van Duren <pgpool@list.imperialat.at>
Discussion: [pgpool-hackers: 4588] Shuffle random functions and use better random numbers
https://www.pgpool.net/pipermail/pgpool-hackers/2025-May/004589.html
src/Makefile.am
src/auth/pool_auth.c
src/include/pool.h
src/utils/pg_strong_random.c [new file with mode: 0644]