pgsql: Minimal fix for unterminated tar archive problem. - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Minimal fix for unterminated tar archive problem.
Date
Msg-id E1mkCNm-00029g-1R@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Minimal fix for unterminated tar archive problem.

Commit 23a1c6578c87fca0e361c4f5f9a07df5ae1f9858 improved
pg_basebackup's ability to parse tar archives, but also arranged
to parse them only when we need to make some modification to the
contents of the archive. That's a problem, because the server
doesn't actually terminate tar archives. When the new parsing
logic was engaged, pg_basebackup would properly terminate the
tar file, but when it was skipped, pg_basebackup would just write
whatever it got from the server, meaning that the terminator
was missing.

Most versions of tar are willing to overlook the missing terminator, but
the AIX buildfarm animals were not. Fix by inventing a new kind of
bbstreamer that just blindly adds a terminator, and using it whenever we
don't parse the tar archive.

Discussion: http://postgr.es/m/CA+TgmoZbNzsWwM4BE5Jb_qHncY817DYZwGf+2-7hkMQ27ZwsMQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/57b5a9646d97a3e8a5b6b6d86b375cc8da6ac85c

Modified Files
--------------
src/bin/pg_basebackup/bbstreamer.h     |  1 +
src/bin/pg_basebackup/bbstreamer_tar.c | 72 ++++++++++++++++++++++++++++++++++
src/bin/pg_basebackup/pg_basebackup.c  |  6 ++-
3 files changed, 78 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix incorrect format placeholder.
Next
From: Tom Lane
Date:
Subject: pgsql: Stamp 14.1.