Re: Patch: initdb: "'" for QUOTE_PATH (non-windows) - Mailing list pgsql-hackers

From Ryan Murphy
Subject Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)
Date
Msg-id CAHeEsBdkLnu796oAtvHVBYR2Kd__-437b6+vPfY24sjWujXRkA@mail.gmail.com
Whole thread Raw
In response to Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
That's a fair point Michael.  I would be willing to make such a change,<span></span> but since c doesn't have optional
functionarguments I'm not sure the least intrusive way to do that.  Do you have a suggestion?<br /><br />On Wednesday,
August17, 2016, Michael Paquier <<a href="mailto:michael.paquier@gmail.com">michael.paquier@gmail.com</a>>
wrote:<br/><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On
Thu,Aug 18, 2016 at 12:21 AM, Ryan Murphy <<a href="javascript:;">ryanfmurphy@gmail.com</a>> wrote:<br /> > I
havecreated a better patch (attached) that correctly escapes the shell<br /> > arguments using PQExpBufferStr and
theappendShellString function, as per<br /> > Michael and Andres' suggestions.<br /> ><br /> > Further
suggestionswelcome of course.<br /><br /> As far as I know, it is perfectly possible to have LF/CR in a path<br /> name
(that'sbad practice btw...), and your patch would make initdb<br /> fail in such cases. Do we want to authorize that?
Ifwe bypass the<br /> error checks in appendShellString with an extra option, and have<br /> initdb use that, the
generatedcommand would be actually correct.<br /> --<br /> Michael<br /></blockquote> 

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: CLUSTER, reform_and_rewrite_tuple(), and parallelism
Next
From: Peter Geoghegan
Date:
Subject: Re: CLUSTER, reform_and_rewrite_tuple(), and parallelism