mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
fix(postgres): know PostgreSQL 19's catalog functions and refuse regdatabase
PostgreSQL 19 adds 41 functions to pg_catalog that the plugin guard's catalog list did not hold, so PGPLUG-021 failed on the 19 lane and a plugin could call the new ones the allowlist does not name. They are now in catalog-functions.txt, taken from 19's pg_proc.dat; none of them joins the plugin allowlist. 19 also adds the object identifier type regdatabase, whose input looks a database of the cluster up by its name. A cast to it passed the guard, so a plugin could probe which databases the server holds. It now joins the other name lookup types, its array type with it.
This commit is contained in:
@@ -268,6 +268,11 @@ describe('plugin SQL guard', () => {
|
||||
["select 'english'::regconfig", /"regconfig" may not be named/],
|
||||
["select 'simple'::regdictionary", /"regdictionary" may not be named/],
|
||||
["select '{public.users}'::_regclass", /"_regclass" may not be named/],
|
||||
// PostgreSQL 19's regdatabase looks a database of the cluster up by its name.
|
||||
["select 'postgres'::regdatabase::oid", /"regdatabase" may not be named/],
|
||||
["select cast('other_app' as regdatabase)", /"regdatabase" may not be named/],
|
||||
["select '{postgres}'::_regdatabase", /"_regdatabase" may not be named/],
|
||||
["select to_regdatabase('other_app')", /"to_regdatabase" may not be named/],
|
||||
["select 'x'::pg_catalog.regtype", /"pg_catalog" may not be named/],
|
||||
["select has_table_privilege('public.users', 'select')", /"has_table_privilege" may not be named/],
|
||||
["select currtid2('public.users', '(0,1)')", /"currtid2" may not be named/],
|
||||
|
||||
Reference in New Issue
Block a user