Skip to content

Commit c9ae7f7

Browse files
committed
Fix cross-version compatibility checks of pg_verify_checksums
pg_verify_checksums performs a read of the control file, and the data it fetches should be from a data folder compatible with the major version of Postgres the binary has been compiled with, but we never actually checked that compatibility. Reported-by: Sergei Kornilov Author: Michael Paquier Reviewed-by: Sergei Kornilov Discussion: https://postgr.es/m/155231347133.16480.11453587097036807558.pgcf@coridan.postgresql.org Backpatch-through: 11
1 parent 3f34283 commit c9ae7f7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bin/pg_verify_checksums/pg_verify_checksums.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ main(int argc, char *argv[])
316316
exit(1);
317317
}
318318

319+
if (ControlFile->pg_control_version != PG_CONTROL_VERSION)
320+
{
321+
fprintf(stderr, _("%s: cluster is not compatible with this version of pg_verify_checksums\n"),
322+
progname);
323+
exit(1);
324+
}
325+
319326
if (ControlFile->state != DB_SHUTDOWNED &&
320327
ControlFile->state != DB_SHUTDOWNED_IN_RECOVERY)
321328
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy