Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)

From: Ryan Murphy <ryanfmurphy(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)
Date: 2016-08-18 00:30:02
Message-ID: CAHeEsBdkLnu796oAtvHVBYR2Kd__-437b6+vPfY24sjWujXRkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

That's a fair point Michael. I would be willing to make such a change, but
since c doesn't have optional function arguments I'm not sure the least
intrusive way to do that. Do you have a suggestion?

On Wednesday, August 17, 2016, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Thu, Aug 18, 2016 at 12:21 AM, Ryan Murphy <ryanfmurphy(at)gmail(dot)com
> <javascript:;>> wrote:
> > I have created a better patch (attached) that correctly escapes the shell
> > arguments using PQExpBufferStr and the appendShellString function, as per
> > Michael and Andres' suggestions.
> >
> > Further suggestions welcome of course.
>
> As far as I know, it is perfectly possible to have LF/CR in a path
> name (that's bad practice btw...), and your patch would make initdb
> fail in such cases. Do we want to authorize that? If we bypass the
> error checks in appendShellString with an extra option, and have
> initdb use that, the generated command would be actually correct.
> --
> Michael
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2016-08-18 00:35:32 Re: CLUSTER, reform_and_rewrite_tuple(), and parallelism
Previous Message Andres Freund 2016-08-18 00:20:06 Re: CLUSTER, reform_and_rewrite_tuple(), and parallelism