]> granicus.if.org Git - postgresql/commit
Make contrib/unaccent's unaccent() function work when not in search path.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Sep 2018 14:49:45 +0000 (10:49 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 6 Sep 2018 14:49:45 +0000 (10:49 -0400)
commit25ff97ba77cbf8e3c08b4706328c50a470efd0ae
treeebef490326caebf01e679f5e434602775b18b01e
parent630d4451adc6292f8781fcc664d2c8f27de0d59b
Make contrib/unaccent's unaccent() function work when not in search path.

Since the fixes for CVE-2018-1058, we've advised people to schema-qualify
function references in order to fix failures in code that executes under
a minimal search_path setting.  However, that's insufficient to make the
single-argument form of unaccent() work, because it looks up the "unaccent"
text search dictionary using the search path.

The most expedient answer seems to be to remove the search_path dependency
by making it look in the same schema that the unaccent() function itself
is declared in.  This will definitely work for the normal usage of this
function with the unaccent dictionary provided by the extension.
It's barely possible that there are people who were relying on the
search-path-dependent behavior to select other dictionaries with the same
name; but if there are any such people at all, they can still get that
behavior by writing unaccent('unaccent', ...), or possibly
unaccent('unaccent'::text::regdictionary, ...) if the lookup has to be
postponed to runtime.

Per complaint from Gunnlaugur Thor Briem.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/CAPs+M8LCex6d=DeneofdsoJVijaG59m9V0ggbb3pOH7hZO4+cQ@mail.gmail.com
contrib/unaccent/unaccent.c
doc/src/sgml/unaccent.sgml