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

Re: BUG #2495: -i start up option blows pg_ctl program.

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ermest <whitelaw(at)netc(dot)pt>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2495: -i start up option blows pg_ctl program.
Date: 2006-06-25 00:01:22
Message-ID: 20060625000122.GD5316@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > There is indeed a bug in pg_ctl here.  We are reporting an error which
> > getopt_long already reported; and furthermore, optarg is not set by that
> > function in case of error.  This is the fix:
> 
> Good catch, but I'd suggest not just removing the write_stderr but
> adding a comment in its place:
> 
> 	/* getopt_long already issued a suitable error message */
> 
> Please commit fix in all relevant branches.

I'm working on it.

7.3 does not have our getopt_long, so the first branch to check is 7.4.

In my system, on 7.4, contrib/pg_dumplo is linked against the system's
getopt_long, not against our version.  So the current code is OK -- but
if on some platform there is no getopt_long, I suspect our version would
be picked, which causes a problem.  What should we do about it?  One
thought is leave it alone -- it's an old branch and no one has ever
noticed this problem before.  On the other hand, this may possibly be a
security issue.

On 7.4, pg_ctl was still a shell script, so the exact problem at hand
does not exist.

On 8.0 there is no pg_dumplo, and pg_ctl is the only program which shows
this problem.

I'm still investigating other branches.

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
"No hay ausente sin culpa ni presente sin disculpa" (Prov. franc├ęs)

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-06-25 16:14:56
Subject: Re: BUG #2495: -i start up option blows pg_ctl program.
Previous:From: Magnus HaganderDate: 2006-06-24 11:45:01
Subject: Re: BUG #2493: bug with initdb under an administrator

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