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

Commitd4d0ec9

Browse files
committed
Move connect.h from fe_utils to src/include/common.
Any libpq client can use the header. Clients include backend componentspostgres_fdw, dblink, and logical replication apply worker. Back-patchto v10, because another fix needs this. In released branches, just copythe header and keep the original.
1 parent3ba9670 commitd4d0ec9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

‎src/include/common/connect.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* Interfaces in support of FE/BE connections.
4+
*
5+
*
6+
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
7+
* Portions Copyright (c) 1994, Regents of the University of California
8+
*
9+
* src/include/common/connect.h
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndefCONNECT_H
14+
#defineCONNECT_H
15+
16+
/*
17+
* This SQL statement installs an always-secure search path, so malicious
18+
* users can't take control. CREATE of an unqualified name will fail, because
19+
* this selects no creation schema. This does not demote pg_temp, so it is
20+
* suitable where we control the entire FE/BE connection but not suitable in
21+
* SECURITY DEFINER functions. This is portable to PostgreSQL 7.3, which
22+
* introduced schemas. When connected to an older version from code that
23+
* might work with the old server, skip this.
24+
*/
25+
#defineALWAYS_SECURE_SEARCH_PATH_SQL \
26+
"SELECT pg_catalog.set_config('search_path', '', false);"
27+
28+
#endif/* CONNECT_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp