pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Minimal fix for unterminated tar archive problem.
Date: Mon, 08 Nov 2021 21:40:50 +0000
Message-ID: <E1mkCNm-00029g-1R@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1mkCNm-00029g-1R@gemulon.postgresql.org>
Permalink:  ../E1mkCNm-00029g-1R@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mkCNm-00029g-1R@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Minimal fix for unterminated tar archive problem.
  In-Reply-To: <E1mkCNm-00029g-1R@gemulon.postgresql.org>
  References: <E1mkCNm-00029g-1R@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox