[CF2016-9] Allow spaces in working path on tap-tests

Started by Kyotaro Horiguchialmost 10 years ago11 messageshackers
Jump to latest
#1Kyotaro Horiguchi
horikyota.ntt@gmail.com

Hello, this is just an entry mail for the next CF.

The tap-test fails when the soruce directoy containing spaces. I
accidentially hit this by a Jenkins project with the name "test
project".

The function system_log() is safe for such parameters but
backup() uses it in wrong way. On the other hand,
enable_restoring() and enable_archiving() forgets to quote such a
path containing spaces as already done for Windows. I don't see
the similar problem in other places.

regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

0001-Allow-spaces-in-working-directory-path-on-TAP-tests.patchtext/x-patch; charset=us-asciiDownload+4-4
#2Michael Paquier
michael@paquier.xyz
In reply to: Kyotaro Horiguchi (#1)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Mon, Jul 4, 2016 at 4:02 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

Hello, this is just an entry mail for the next CF.

The tap-test fails when the soruce directoy containing spaces. I
accidentially hit this by a Jenkins project with the name "test
project".

The function system_log() is safe for such parameters but
backup() uses it in wrong way. On the other hand,
enable_restoring() and enable_archiving() forgets to quote such a
path containing spaces as already done for Windows. I don't see
the similar problem in other places.

Good catch, your fix looks good to me. I am noticing as well that the
invocations of pg_ctl, pg_dumpall, pg_upgrade and diff are likely
broken the same way in vcregress.pl.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#2)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Mon, Jul 4, 2016 at 4:29 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

On Mon, Jul 4, 2016 at 4:02 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

Hello, this is just an entry mail for the next CF.

The tap-test fails when the soruce directoy containing spaces. I
accidentially hit this by a Jenkins project with the name "test
project".

The function system_log() is safe for such parameters but
backup() uses it in wrong way. On the other hand,
enable_restoring() and enable_archiving() forgets to quote such a
path containing spaces as already done for Windows. I don't see
the similar problem in other places.

Good catch, your fix looks good to me. I am noticing as well that the
invocations of pg_ctl, pg_dumpall, pg_upgrade and diff are likely
broken the same way in vcregress.pl.

And as is the command built for zic.exe in Install.pm, no? $target is
normally an absolute path per the call of Install().
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#3)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Mon, Jul 4, 2016 at 4:44 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

And as is the command built for zic.exe in Install.pm, no? $target is
normally an absolute path per the call of Install().

Attached is the patch I have in mind. After more investigation zic.exe
is indeed broken, $target can be a full path, and if it contains a
space things blow up. The commands of vcregress upgradecheck need a
cleanup as well. I have merged both patches together and the part for
src/tools/msvc needs a backpatch. Separating both things is trivial
anyway as the MSVC and the TAP stuff are on two completely separate
paths.
--
Michael

Attachments:

fix-perl-system.patchtext/x-diff; charset=US-ASCII; name=fix-perl-system.patchDownload+38-18
#5Kyotaro Horiguchi
horikyota.ntt@gmail.com
In reply to: Michael Paquier (#4)
Re: [CF2016-9] Allow spaces in working path on tap-tests

Hello,

At Tue, 5 Jul 2016 13:44:08 +0900, Michael Paquier <michael.paquier@gmail.com> wrote in <CAB7nPqSt2W30tE12eRq7KGB_FPcBpXDX2Zh8XeH2QHFY9Vfb8Q@mail.gmail.com>

On Mon, Jul 4, 2016 at 4:44 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:

And as is the command built for zic.exe in Install.pm, no? $target is
normally an absolute path per the call of Install().

Attached is the patch I have in mind. After more investigation zic.exe
is indeed broken, $target can be a full path, and if it contains a
space things blow up. The commands of vcregress upgradecheck need a
cleanup as well. I have merged both patches together and the part for
src/tools/msvc needs a backpatch. Separating both things is trivial
anyway as the MSVC and the TAP stuff are on two completely separate
paths.

Agreed. Grep'ing "system" in the source tree, I see no more place
where needs the same fix.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#6Michael Paquier
michael@paquier.xyz
In reply to: Kyotaro Horiguchi (#5)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Tue, Jul 5, 2016 at 6:02 PM, Kyotaro HORIGUCHI
<horiguchi.kyotaro@lab.ntt.co.jp> wrote:

Agreed. Grep'ing "system" in the source tree, I see no more place
where needs the same fix.

Same conclusion here. I have added this stuff to the official patch tracker:
https://commitfest.postgresql.org/10/663/
I can as well produce patches for back-branches, feel free to ping me
if necessary.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kyotaro Horiguchi (#5)
Re: [CF2016-9] Allow spaces in working path on tap-tests

Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:

At Tue, 5 Jul 2016 13:44:08 +0900, Michael Paquier <michael.paquier@gmail.com> wrote in <CAB7nPqSt2W30tE12eRq7KGB_FPcBpXDX2Zh8XeH2QHFY9Vfb8Q@mail.gmail.com>

Attached is the patch I have in mind. After more investigation zic.exe
is indeed broken, $target can be a full path, and if it contains a
space things blow up. The commands of vcregress upgradecheck need a
cleanup as well. I have merged both patches together and the part for
src/tools/msvc needs a backpatch. Separating both things is trivial
anyway as the MSVC and the TAP stuff are on two completely separate
paths.

Agreed. Grep'ing "system" in the source tree, I see no more place
where needs the same fix.

This seemed like a bug fix to me, so I went ahead and pushed it. I don't
have any ability to test the Windows parts, so it's possible I missed
something in the back-patching; please review.

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

#8Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#7)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Sun, Jul 10, 2016 at 5:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

This seemed like a bug fix to me ...

Yes, it is.

... so I went ahead and pushed it. I don't
have any ability to test the Windows parts, so it's possible I missed
something in the back-patching; please review.

Thanks! What you have pushed looks fine to me. Also, the portion for
src/tools/msvc needs to go further down, I should have precised that
earlier. Do you want a patch for that?
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#8)
Re: [CF2016-9] Allow spaces in working path on tap-tests

Michael Paquier <michael.paquier@gmail.com> writes:

Thanks! What you have pushed looks fine to me. Also, the portion for
src/tools/msvc needs to go further down, I should have precised that
earlier. Do you want a patch for that?

Yes, please --- I thought it'd all gotten done.

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

#10Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#9)
Re: [CF2016-9] Allow spaces in working path on tap-tests

On Sun, Jul 10, 2016 at 11:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Michael Paquier <michael.paquier@gmail.com> writes:

Thanks! What you have pushed looks fine to me. Also, the portion for
src/tools/msvc needs to go further down, I should have precised that
earlier. Do you want a patch for that?

Yes, please --- I thought it'd all gotten done.

OK, here are patches for 9.1, 9.2 and 9.3.
--
Michael

Attachments:

fix-perl-system-91.patchtext/x-patch; charset=US-ASCII; name=fix-perl-system-91.patchDownload+20-9
fix-perl-system-92.patchtext/x-patch; charset=US-ASCII; name=fix-perl-system-92.patchDownload+36-17
fix-perl-system-93.patchtext/x-patch; charset=US-ASCII; name=fix-perl-system-93.patchDownload+35-16
#11Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#10)
Re: [CF2016-9] Allow spaces in working path on tap-tests

Michael Paquier <michael.paquier@gmail.com> writes:

On Sun, Jul 10, 2016 at 11:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Yes, please --- I thought it'd all gotten done.

OK, here are patches for 9.1, 9.2 and 9.3.

Pushed, thanks.

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