pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix assorted inconsistencies in our calls of readlink().
Date: Thu, 28 May 2015 16:17:28 +0000
Message-ID: <E1Yy0Uq-0004O1-6f@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix assorted inconsistencies in our calls of readlink().

Ensure that we null-terminate the result string (one place in pg_rewind).
Be paranoid about out-of-range results from readlink() (should not happen,
but there is no good reason for some call sites to be careful about it and
others not).  Consistently use the whole buffer, not sometimes one byte
less.  Ensure we emit an appropriate errcode() in all cases.  Spell the
error messages the same way.

The only serious bug here is the missing null-termination in pg_rewind,
which is new code, so no need for a back-patch.

Abhijit Menon-Sen and Tom Lane

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/32f628be74d8ab43423ca7913b81f7eb21b312d4

Modified Files
--------------
src/backend/replication/basebackup.c |    3 ++-
src/backend/storage/file/fd.c        |    9 ++++-----
src/backend/utils/adt/misc.c         |    8 +++++---
src/bin/pg_rewind/copy_fetch.c       |   17 +++++++----------
4 files changed, 18 insertions(+), 19 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1Yy0Uq-0004O1-6f@gemulon.postgresql.org>
Permalink:  ../E1Yy0Uq-0004O1-6f@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1Yy0Uq-0004O1-6f@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix assorted inconsistencies in our calls of readlink().
  In-Reply-To: <E1Yy0Uq-0004O1-6f@gemulon.postgresql.org>
  References: <E1Yy0Uq-0004O1-6f@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