Re: pg_upgrade segfaults when given an invalid PGSERVICE value - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date
Msg-id 20130320160638.GA13677@momjian.us
Whole thread Raw
In response to Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Steve Singer <ssinger@ca.afilias.info>)
Responses Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote:
> >so it is clearly possible for PQconndefaults() to return NULL for
> >service file failures.  The questions are:
> >
> >*  Is this what we want?
>
> What other choices do we have? I don't think PQconndefaults() should
> continue on as if PGSERVICE wasn't set in the environment after a
> failure from parseServiceInfo.

True.  Ignoring a service specification seems wrong, and issuing a
warning message weak.

> >*  Should we document this?
>
> Yes the documentation should indicate that PQconndefaults() can
> return NULL for more than just memory failures.

The attached patch fixes this.  I am unclear about backpatching this as
it hits lot of code, is rare, and adds new translation strings.  On the
other hand, it does crash the applications.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Attachment

pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: [pgsql-advocacy] Call for Google Summer of Code mentors, admins
Next
From: Marc Cousin
Date:
Subject: Re: Problem with background worker