pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tighten up allowed names for custom GUC parameters.
Date: Wed, 07 Apr 2021 15:22:29 +0000
Message-ID: <E1lUA0j-0008WN-7s@gemulon.postgresql.org> (raw)

Tighten up allowed names for custom GUC parameters.

Formerly we were pretty lax about what a custom GUC's name could
be; so long as it had at least one dot in it, we'd take it.
However, corner cases such as dashes or equal signs in the name
would cause various bits of functionality to misbehave.  Rather
than trying to make the world perfectly safe for that, let's
just require that custom names look like "identifier.identifier",
where "identifier" means something that scan.l would accept
without double quotes.

Along the way, this patch refactors things slightly in guc.c
so that find_option() is responsible for reporting GUC-not-found
cases, allowing removal of duplicative code from its callers.

Per report from Hubert Depesz Lubaczewski.  No back-patch,
since the consequences of the problem don't seem to warrant
changing behavior in stable branches.

Discussion: https://postgr.es/m/951335.1612910077@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3db826bd55cd1df0dd8c3d811f8e5b936d7ba1e4

Modified Files
--------------
src/backend/utils/misc/guc-file.l |   4 +-
src/backend/utils/misc/guc.c      | 167 ++++++++++++++++++++++----------------
src/test/regress/expected/guc.out |  21 +++++
src/test/regress/sql/guc.sql      |  10 +++
4 files changed, 132 insertions(+), 70 deletions(-)



Message-ID: <E1lUA0j-0008WN-7s@gemulon.postgresql.org>
Permalink:  ../E1lUA0j-0008WN-7s@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lUA0j-0008WN-7s@gemulon.postgresql.org

 · 

reply

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: Tighten up allowed names for custom GUC parameters.
  In-Reply-To: <E1lUA0j-0008WN-7s@gemulon.postgresql.org>
  References: <E1lUA0j-0008WN-7s@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