Re: TODO Done. Superuser backend slot reservations

Поиск
Список
Период
Сортировка
От Nigel J. Andrews
Тема Re: TODO Done. Superuser backend slot reservations
Дата
Msg-id Pine.LNX.4.21.0208261055020.576-100000@ponder.fairway2k.co.uk
обсуждение исходный текст
Ответ на Re: TODO Done. Superuser backend slot reservations  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: TODO Done. Superuser backend slot reservations  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 26 Aug 2002, Tom Lane wrote:

> "Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> > +     if (!superuser() && MyBackendId > MaxBackends - ReservedBackends)
> > +         elog(ERROR, "Normal user limit exceeded");
>
> This coding is wrong on its face: the slot number you happen to find has
> no relationship to the number of slots remaining free, except as an
> existence proof that the number of slots free was > 0 before you took
> one.

Yes.

I was taking the line that the last slots in the array are reserved. Those are
not going to be taken by non su connections. Therefore, if MyBackendId is
under the lower limit it doesn't matter if it's the only slot free since the
'safety' measure has already been used in restricting access to the last free
slots and it just so happens that those sessions are still active.

I take Neil's point about the order of the tests. That's my stupidity when
rearranging stuff after noticing in tests that the user information wasn't
available where I was [also stupidly] expecting it to be first time around.


--
Nigel J. Andrews


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

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: PostgreSQL 7.2.2 and docs
Следующее
От: Sir Mordred The Traitor
Дата:
Сообщение: @(#)Mordred Labs advisory 0x0006: Two minor DoS conditions in PostgreSQL