From: Tom Lane <tgl@sss.pgh.pa.us>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
Date: Tue, 06 Sep 2016 13:41:26 -0400
Message-ID: <6078.1473183686@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGTBQpaFaQb5gaoVvU+3GGu7zx0XCJy0C9GrhA10SB8sbKJRCQ@mail.gmail.com>
References: <E1bbBaE-0001j6-Gz@gemulon.postgresql.org>
<ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com>
<26516.1473181731@sss.pgh.pa.us>
<CAGTBQpaFaQb5gaoVvU+3GGu7zx0XCJy0C9GrhA10SB8sbKJRCQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Claudio Freire <klaussfreire@gmail.com> writes:
> On Tue, Sep 6, 2016 at 2:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Dash is considered a character that needs quoting. It might be possible
>> to avoid that if we could be certain that appendShellString's output would
>> never be placed in a spot where it could be taken for a switch, but that
>> seems like a large assumption to me.
> Wouldn't it be taken for a switch even with quoting?
> Quoting "-D" seems to work fine, which would suggest the above is true.
[ thinks about that... ] Oh, you're right, brain fade on my part. The
shell doesn't care whether words are switches or not. So actually the
risk-factor for us is whether we have designed any command-line syntaxes
in a way that would allow a path starting with a dash to cause bad things
to happen. I have a feeling the answer is "yes", even without considering
the prospect that GNU getopt will arbitrarily rearrange the command words
on us depending on what it thinks is a switch. (Maybe leading-dash is
another one of the things we'd better make a policy against.)
But meanwhile, yes, the argument for treating it as quotable in
appendShellString seems completely bogus. I'll go change that.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, klaussfreire@gmail.com, peter.eisentraut@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
In-Reply-To: <6078.1473183686@sss.pgh.pa.us>
References: <E1bbBaE-0001j6-Gz@gemulon.postgresql.org> <ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com> <26516.1473181731@sss.pgh.pa.us> <CAGTBQpaFaQb5gaoVvU+3GGu7zx0XCJy0C9GrhA10SB8sbKJRCQ@mail.gmail.com> <6078.1473183686@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox