Re: SECURITY DEFINER not being propagated...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SECURITY DEFINER not being propagated...
Дата
Msg-id 5523.1083211420@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SECURITY DEFINER not being propagated...  (Sean Chittenden <sean@chittenden.org>)
Ответы Re: SECURITY DEFINER not being propagated...  (Sean Chittenden <sean@chittenden.org>)
Список pgsql-patches
Sean Chittenden <sean@chittenden.org> writes:
> Without any rationale as to why CREATE TEMP TABLEs checks the session
> user in the archives, could we open this up for discussion again?

Well, let me put it this way: if you want to change the behavior you're
going to have to work much harder than just reverting the prior patch.

IIRC the fundamental reason the code works that way is that
InitTempTableNamespace is done only once per session.  If it checks
against current_user rather than session_user then (a) the results will
be inconsistent, and (b) you create a different sort of security hole,
which is that if a setuid function is the first to try to create a temp
table in a particular session, then not-so-privileged functions will
still be able to create temp tables later in the session.

> At the moment, this behavior cripples the usefulness
> of having a TEMP table be used as a trusted cache for data.

What exactly do you think makes a temp table suitable as a trusted
cache?  Or more suitable than non-temp tables?

I don't really believe in the notion of restricting temp table creation
to setuid functions.  AFAICS the only reason for forbidding temp table
creation is to prevent a session from using any on-disk resources, and
that hardly works if it can still do so via calling setuid functions.

            regards, tom lane

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

Предыдущее
От: Sean Chittenden
Дата:
Сообщение: Re: SECURITY DEFINER not being propagated...
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Basic subtransaction facility