From 186ee37a570b2baaaafcb200ee4c6f3462f57f66 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Thu, 3 Oct 2019 16:54:55 +0200 Subject: [PATCH] CDB_Username: Set secure search_path --- scripts-available/CDB_Username.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts-available/CDB_Username.sql b/scripts-available/CDB_Username.sql index adc1427..7aa3c77 100644 --- a/scripts-available/CDB_Username.sql +++ b/scripts-available/CDB_Username.sql @@ -2,5 +2,9 @@ CREATE OR REPLACE FUNCTION @extschema@.CDB_Username() RETURNS text AS $$ - SELECT @extschema@.CDB_Conf_GetConf(CONCAT('api_keys_', session_user))->>'username'; -$$ LANGUAGE SQL STABLE PARALLEL SAFE SECURITY DEFINER; + SELECT @extschema@.CDB_Conf_GetConf(concat('api_keys_', session_user))->>'username'; +$$ LANGUAGE SQL + STABLE + PARALLEL SAFE + SECURITY DEFINER + SET search_path = @extschema@, pg_temp;