Re: Patch: incorrect array offset in backend replication tar header

From: Brian Weaver <cmdrclueless(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: incorrect array offset in backend replication tar header
Date: 2012-09-27 22:18:36
Message-ID: CAAhXZGvEWBT7eTGhYgqq-CD8LcBarL5YeHUXaJ4MHHeJkFikGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

OK, here is my attempt at patching and correcting the issue in this
thread. I have done my best to test to ensure that hot standby,
pg_basebackup, and pg_restore of older files work without issues. I
think this might be a larger patch that expected, I took some
liberties of trying to clean up a bit.

For example the block size '512' was scattered throughout the code
regarding the tar block size. I've replace instances of that with a
defined constant TAR_BLOCK_SIZE. I've likewise created other constants
and used them in place of raw numbers in what I hope makes the code a
bit more readable.

I've also used functions like strncpy(), strnlen(), and the like in
place of sprintf() where I could. Also instead of using sscanf() I
used a custom octal conversion routine which has a hard limit on how
many character it will process like strncpy() & strnlen().

I expect comments, hopefully they'll be positive.

-- Brian
--

/* insert witty comment here */

Attachment Content-Type Size
postgresql-tar.patch application/octet-stream 38.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-09-27 22:20:43 Re: Patch: incorrect array offset in backend replication tar header
Previous Message Brian Weaver 2012-09-27 22:12:14 Re: Patch: incorrect array offset in backend replication tar header