From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Avoid putting build-location-dependent strings into generated fi
Date: Thu, 21 Dec 2017 15:57:17 +0000
Message-ID: <E1eS3Dh-00049c-IP@gemulon.postgresql.org> (raw)
Avoid putting build-location-dependent strings into generated files.
Various Perl scripts we use to generate files were in the habit of
printing things like "generated by $0" into their output files.
That looks like a fine idea at first glance, but it results in
non-reproducible output, because in VPATH builds $0 won't be just
the name of the script file, but a full path for it. We'd prefer
that you get identical results whether using VPATH or not, so this
is a bad thing.
Some of these places also printed their input file name(s), causing
an additional hazard of the same type.
Hence, establish a policy that thou shalt not print $0, nor input file
pathnames, into output files (they're still allowed in error messages,
though). Instead just write the script name verbatim. While we are at
it, we can make these annotations more useful by giving the script's
full relative path name within the PG source tree, eg instead of
Gen_fmgrtab.pl let's print src/backend/utils/Gen_fmgrtab.pl.
Not all of the changes made here actually affect any files shipped
in finished tarballs today, but it seems best to apply the policy
everyplace so that nobody copies unsafe code into places where it
could matter.
Christoph Berg and Tom Lane
Discussion: https://postgr.es/m/20171215102223.GB31812@msg.df7cb.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c98c35cd084a25c6cf9b08c76de8b89facd75fe7
Modified Files
--------------
src/backend/catalog/genbki.pl | 2 +-
src/backend/utils/Gen_fmgrtab.pl | 9 +++------
src/backend/utils/mb/Unicode/UCS_to_BIG5.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_GB18030.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_UHC.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_most.pl | 2 +-
src/bin/psql/create_help.pl | 8 +++-----
src/pl/plperl/text2macro.pl | 2 +-
src/test/perl/TestLib.pm | 2 +-
17 files changed, 21 insertions(+), 26 deletions(-)
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
Subject: Re: pgsql: Avoid putting build-location-dependent strings into generated fi
In-Reply-To: <E1eS3Dh-00049c-IP@gemulon.postgresql.org>
References: <E1eS3Dh-00049c-IP@gemulon.postgresql.org>
* 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