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

Re: windows / initdb oddness

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: windows / initdb oddness
Date: 2006-02-22 12:38:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches

Magnus Hagander wrote:

>>>The solution would be put --restrictedexec earlier on the 
>>new command 
>>>line. I'll work on that.
>>The probem is apparently the one I identified above, and is 
>>fixed by the attached patch, which I will apply soon unless 
>>there are objections.
>>As for why we saw this on loris but not snake, I suspect they 
>>might have different getopt libraries installed.
>Isn't that just fixing the symptom and not the actual bug? In this case,
>if we cause the bug, we should do this as well, but doesn't it crash the
>same way if you *manually* put arguments in the "wrong order" on the
>commandline? Like "inidb foo --no-locale" or somehting like that?
>(I still can't reproduce it on my machines, so I guess I have a better
>getopt as well.)

We don't promise that you can put the pgdata argument anywhere except at 
the end of the command line. In fact, our manual page requires it at the 
end. Even on systems with GNU getopt, if POSIXLY_CORRECT is set then 
processing would stop at the first non-getopt argument.

So I can live with bombing, even if it's a bit unpleasant, in the case 
of  "initdb foo --no-locale", but we cannot *cause* that by appending a 
secret argument ourselves, so that "initdb foo" also bombs.

The logic to detect and correct this in the general case before getopt 
is called is not worth the pain.



In response to


pgsql-hackers by date

Next:From: Andrew DunstanDate: 2006-02-22 12:44:54
Subject: Re: PostgreSQL unit tests
Previous:From: Andreas PflugDate: 2006-02-22 11:09:39
Subject: Re: pg_config, pg_service.conf, postgresql.conf ....

pgsql-patches by date

Next:From: Andrew DunstanDate: 2006-02-22 16:12:22
Subject: Re: windows / initdb oddness
Previous:From: David FetterDate: 2006-02-22 07:31:14
Subject: Re: Uninstall scripts for contrib

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