pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Noah Misch <noah@leadboat.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Davis <jdavis@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations.
Date: Mon, 12 Jun 2023 17:20:47 -0700
Message-ID: <2985f969b292258ca007e9916839e2d07359ec15.camel@j-davis.com> (raw)
In-Reply-To: <CA+TgmoaSJDJMqn-E5Xp=6Ojc_1C_MKnBPyctAOF1buBU=RPEiw@mail.gmail.com>
References: <E1q7j7Y-000z1H-Hr@gemulon.postgresql.org>
	<89a415b86d5421941e4281ba5bf6288934078624.camel@j-davis.com>
	<d20864b929ff769a0ebf772359719f05bb6982cd.camel@j-davis.com>
	<573014.1686375211@sss.pgh.pa.us>
	<20230612170510.GA201972@gust.leadboat.com>
	<CA+TgmoaSJDJMqn-E5Xp=6Ojc_1C_MKnBPyctAOF1buBU=RPEiw@mail.gmail.com>

On Mon, 2023-06-12 at 13:33 -0400, Robert Haas wrote:
> I wonder why this commit used pg_catalog, pg_temp rather than just
> the
> empty string, as AutoVacWorkerMain does.

I followed the rules here for "Writing SECURITY DEFINER Functions
Safely":

https://www.postgresql.org/docs/16/sql-createfunction.html

which suggests adding pg_temp at the end (otherwise it is searched
first by default).

It's not exactly like a SECURITY DEFINER function, but running a
maintenance command does switch to the table owner, so the risks are
similar.

I don't see a problem with the pg_temp schema in non-interactive
processes, because we trust the non-interactive processes.

Regards,
	Jeff Davis






view thread (59+ messages)  latest in thread

Message-ID: <2985f969b292258ca007e9916839e2d07359ec15.camel@j-davis.com>
Permalink:  ../2985f969b292258ca007e9916839e2d07359ec15.camel@j-davis.com/
Also on:    postgresql.org/message-id/2985f969b292258ca007e9916839e2d07359ec15.camel@j-davis.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: pgsql@j-davis.com, robertmhaas@gmail.com, noah@leadboat.com, tgl@sss.pgh.pa.us, jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations.
  In-Reply-To: <2985f969b292258ca007e9916839e2d07359ec15.camel@j-davis.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