Re: pgsql: libpq: change PQconndefaults() to ignore invalid service files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: libpq: change PQconndefaults() to ignore invalid service files
Date: 2013-12-03 16:42:08
Message-ID: 22753.1386088928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> On Tue, Dec 3, 2013 at 11:30:15AM -0500, Tom Lane wrote:
>> Why does this patch remove the errorMessage argument from
>> pg_fe_getauthname? I gauge the amount of thought that went into
>> that choice by the fact that the comment wasn't updated.

> Oh, the argument was not used, so I remove it. C comment updated.
> Thanks.

My point was that I didn't think you'd thought about error handling.

In particular, it appears to me that if the strdup in pg_fe_getauthname
fails, we'll just let that pass without comment, which is inconsistent
with all the other out-of-memory cases in conninfo_add_defaults.
(I wonder whether any code downstream of this supposes that we always
have a value for the "user" option. It's a pretty safe bet that the
case is hardly ever tested.)

More generally, why is it that we'd want to eliminate any prospect
of reporting other errors in pg_fe_getauthname? Is it such a great
idea that we're ignoring failure returns from pqGetpwuid/GetUserName?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2013-12-03 16:42:24 pgsql: C comment: again update comment for pg_fe_sendauth for error ca
Previous Message Bruce Momjian 2013-12-03 16:33:56 Re: pgsql: libpq: change PQconndefaults() to ignore invalid service files

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2013-12-03 16:44:51 Re: Extension Templates S03E11
Previous Message Stephen Frost 2013-12-03 16:35:45 Re: Extension Templates S03E11