Re: Review of GetUserId() Usage

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Review of GetUserId() Usage
Дата
Msg-id 20141205150256.GM25679@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Review of GetUserId() Usage  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
* Andres Freund (andres@2ndquadrant.com) wrote:
> Is the 'Only allow superusers to signal superuser-owned backends' check
> actually safe that way? I personally try to never use a superuser role
> as the login user, but grant my account a superuser role that doesn't
> inherit. But IIRC PGPROC->roleId won't change, even if a user does SET
> ROLE.

You're correct- but it's exactly the same as it is today.  If you grant
another user your role and then they 'SET ROLE' to you, they can cancel
any of your queries or terminate your backends, regardless of if those
roles have done some other 'SET ROLE'.  This change only removes the
need for those users to 'SET ROLE' to your user first.

The backend isn't considered 'superuser-owned' unless it's the login
role that's a superuser.  It might be interesting to change that to mean
'when a SET ROLE to superuser has been done', but what about security
definer functions or other transient escalation to superuser?  Would
those calls have to muck with PGPROC->roleId?

If we want to go there, it should definitely be a different patch.
Thanks,
    Stephen

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Review of GetUserId() Usage
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: XLOG_PARAMETER_CHANGE (WAL record) missing two params in its desc routine