mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction. This prevents bizarre failures if someone tries to set a value for session_authorization in postgresql.conf. Per report from Fernando Nasser.
This commit is contained in:
parent
dd484de0b0
commit
2bc84b6852
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.77 2003/05/22 17:13:08 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.78 2003/06/06 16:25:35 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -750,6 +750,16 @@ assign_session_authorization(const char *value, bool doit, bool interactive)
|
|||||||
/* not a saved ID, so look it up */
|
/* not a saved ID, so look it up */
|
||||||
HeapTuple userTup;
|
HeapTuple userTup;
|
||||||
|
|
||||||
|
if (! IsTransactionState())
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Can't do catalog lookups, so fail. The upshot of this is
|
||||||
|
* that session_authorization cannot be set in postgresql.conf,
|
||||||
|
* which seems like a good thing anyway.
|
||||||
|
*/
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
userTup = SearchSysCache(SHADOWNAME,
|
userTup = SearchSysCache(SHADOWNAME,
|
||||||
PointerGetDatum(value),
|
PointerGetDatum(value),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user