Re: xlog location arithmetic

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xlog location arithmetic
Date: 2012-03-04 11:26:56
Message-ID: CABUevEzVxwe5pynRwmxV=V_-Qbuavd-5GWqMf1gAezk1graR9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 28, 2012 at 07:21, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Sun, Feb 26, 2012 at 8:53 AM, Euler Taveira de Oliveira
> <euler(at)timbira(dot)com> wrote:
>> On 25-02-2012 09:23, Magnus Hagander wrote:
>>> Do we even *need* the validate_xlog_location() function? If we just
>>> remove those calls, won't we still catch all the incorrectly formatted
>>> ones in the errors of the sscanf() calls? Or am I too deep into
>>> weekend-mode and missing something obvious?
>>>
>> sscanf() is too fragile for input sanity check. Try
>> pg_xlog_location_diff('12/3', '-10/0'), for example. I won't object removing
>> that function if you protect xlog location input from silly users.
>
> After this patch will have been committed, it would be better to change
> pg_xlogfile_name() and pg_xlogfile_name_offset() so that they use
> the validate_xlog_location() function to validate the input.

And I've done this part as well.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2012-03-04 11:55:33 Re: Our regex vs. POSIX on "longest match"
Previous Message Magnus Hagander 2012-03-04 11:26:36 Re: xlog location arithmetic