Re: Patch: incorrect array offset in backend replication tar header - Mailing list pgsql-hackers

From Brian Weaver
Subject Re: Patch: incorrect array offset in backend replication tar header
Date
Msg-id CAAhXZGvEWBT7eTGhYgqq-CD8LcBarL5YeHUXaJ4MHHeJkFikGg@mail.gmail.com
Whole thread Raw
In response to Re: Patch: incorrect array offset in backend replication tar header  (Brian Weaver <cmdrclueless@gmail.com>)
Responses Re: Patch: incorrect array offset in backend replication tar header
List 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

pgsql-hackers by date:

Previous
From: Brian Weaver
Date:
Subject: Re: Patch: incorrect array offset in backend replication tar header
Next
From: Magnus Hagander
Date:
Subject: Re: Patch: incorrect array offset in backend replication tar header