Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: postgresql-tar.patch
Description: application/octet-stream (38.6 KB)

In response to

Responses

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group