Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bc84b6

Browse files
committed
Add defense in assign_session_authorization() against trying to do
catalog lookups when not in a transaction. This prevents bizarrefailures if someone tries to set a value for session_authorization inpostgresql.conf. Per report from Fernando Nasser.
1 parentdd484de commit2bc84b6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎src/backend/commands/variable.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.77 2003/05/22 17:13:08 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.78 2003/06/06 16:25:35 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -750,6 +750,16 @@ assign_session_authorization(const char *value, bool doit, bool interactive)
750750
/* not a saved ID, so look it up */
751751
HeapTupleuserTup;
752752

753+
if (!IsTransactionState())
754+
{
755+
/*
756+
* Can't do catalog lookups, so fail. The upshot of this is
757+
* that session_authorization cannot be set in postgresql.conf,
758+
* which seems like a good thing anyway.
759+
*/
760+
returnNULL;
761+
}
762+
753763
userTup=SearchSysCache(SHADOWNAME,
754764
PointerGetDatum(value),
755765
0,0,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp