Re: [HACKERS] Interest in a SECURITY DEFINER function current_userstack access mechanism?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] Interest in a SECURITY DEFINER function current_userstack access mechanism?
Дата
Msg-id CAFj8pRBK0_L0abONUo9b3=frrptVHTzy7vD4wnXMGuZfSNObXQ@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Interest in a SECURITY DEFINER function current_user stackaccess mechanism?  (Nico Williams <nico@cryptonector.com>)
Ответы Re: [HACKERS] Interest in a SECURITY DEFINER function current_userstack access mechanism?  (Nico Williams <nico@cryptonector.com>)
Список pgsql-hackers


2017-10-18 22:01 GMT+02:00 Nico Williams <nico@cryptonector.com>:
It'd be nice if SECURITY DEFINER functions could see what user invoked
them, but current_user is the DEFINER user, naturally, since that's how
this is done in fmgr_security_definer().

I was thinking that fmgr_security_definer() could keep a global pointer
to a linked list (with automatic nodes) of the save_userid values.  Then
we could have a SQL function for accessing these, something like
pg_current_user(level int) returning text, where level 0 is
current_user, level 1 is "the previous current_user in the stack", and
so on, returning null when level is beyond the top-level.

This seems like a simple, small, easy patch, and since I [think I] need
it I suspect others probably do as well.

Thoughts?

there is a function session_user() already

regards

Pavel


Nico
--


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Nico Williams
Дата:
Сообщение: [HACKERS] Interest in a SECURITY DEFINER function current_user stackaccess mechanism?
Следующее
От: Nico Williams
Дата:
Сообщение: Re: [HACKERS] Interest in a SECURITY DEFINER function current_userstack access mechanism?