From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_dump and search_path
Date: Tue, 9 Jul 2019 08:28:57 -0500
Message-ID: <64b7168a-7fb4-ddb0-f7aa-298638fb64af@gmail.com> (raw)
In-Reply-To: <6e3e7900f9d470c6927112818c0aec59e1f91ac8.camel@cybertec.at>
References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org>
<fb97c1ee-71c6-f513-1345-e894c8d66547@lucee.org>
<6e3e7900f9d470c6927112818c0aec59e1f91ac8.camel@cybertec.at>
On 7/9/19 2:22 AM, Laurenz Albe wrote:
> On Mon, 2019-07-08 at 23:54 -0700, Igal @ Lucee.org wrote:
>>> I have a custom search_path:
>>>
>>> # show search_path;
>>> search_path
>>> ----------------------------------
>>> "staging, transient, pg_catalog"
>>> (1 row)
>>>
>>> I ran `pg_dump --schema-only` and the only reference in the output to
>>> search_path is:
>>>
>>> SELECT pg_catalog.set_config('search_path', '', false);
>>>
>>> Then one of my functions which does not reference the full name of a
>>> table with its schema fails with "relation [rel-name] does not exist".
>>>
>>> Is that a bug? I have seen some old posts about this issue but am not
>>> sure if there is a ticket or why it still is an issue.
>>>
>> Looks like this might be by design. I will follow the links at
>> https://www.postgresql.org/message-id/flat/MWHPR14MB160079A6D9DC64A2F60E9004C0D00%40MWHPR14MB1600.na...
>> and ask more questions if I have them.
>>
>> I might need to add the schema name to the table in my function.
> Right.
>
> Allowing object lookup along the search_path during pg_restore opens
> doors to abuse, because it can make a superuser inadvertedly execute
> code crafted by an attacker.
Then should search_path be set at the end of pg_restore?
--
Angular momentum makes the world go 'round.
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-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: pg_dump and search_path
In-Reply-To: <64b7168a-7fb4-ddb0-f7aa-298638fb64af@gmail.com>
References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org> <fb97c1ee-71c6-f513-1345-e894c8d66547@lucee.org> <6e3e7900f9d470c6927112818c0aec59e1f91ac8.camel@cybertec.at> <64b7168a-7fb4-ddb0-f7aa-298638fb64af@gmail.com>
* 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