Re: Call for objections: deprecate postmaster -o switch? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Call for objections: deprecate postmaster -o switch?
Date
Msg-id 7172.1006736667@sss.pgh.pa.us
Whole thread Raw
In response to Re: Call for objections: deprecate postmaster -o switch?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> No it's not, unfortunately.  BSD versions of getopt, including the one we
> ship as replacement, have a bug that considers any argument that starts
> with '--' to be equivalent with '--' (which means end of options).

I believe we could trivially fix our substitute version: at line 74 of
src/utils/getopt.c,
    if (place[1] && *++place == '-')

should be
    if (place[1] && *++place == '-' && place[1] == '\0')

It might still not work on older BSDen, but there's no reason it
shouldn't work on platforms where we use our own code.

A slightly more aggressive answer would be to use our own code always,
or to test for brokenness of the system getopt in configure and use our
own code if so.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Security note: MS SQL is current worm vector
Next
From: Tom Lane
Date:
Subject: Re: Call for objections: deprecate postmaster -o switch?