Re: Non-superuser subscription owners

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Non-superuser subscription owners
Дата
Msg-id 20230308194743.23rmgjgwahh4i4rg@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: Non-superuser subscription owners  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Non-superuser subscription owners  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

On 2023-02-07 16:56:55 -0500, Robert Haas wrote:
> On Wed, Feb 1, 2023 at 4:02 PM Andres Freund <andres@anarazel.de> wrote:
> > > +     /* Is the use of a password mandatory? */
> > > +     must_use_password = MySubscription->passwordrequired &&
> > > +             !superuser_arg(MySubscription->owner);
> >
> > There's a few repetitions of this - perhaps worth putting into a helper?
> 
> I don't think so. It's slightly different each time, because it's
> pulling data out of different data structures.
> 
> > This still leaks the connection on error, no?
> 
> I've attempted to fix this in v4, attached.

Hm - it still feels wrong that we error out in case of failure, despite the
comment to the function saying:
 * Returns NULL on error and fills the err with palloc'ed error message.

Other than this, the change looks ready to me.

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: postgres_fdw, dblink, and CREATE SUBSCRIPTION security
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Add error functions: erf() and erfc()