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

Commit59743de

Browse files
committed
Fix pg_recvlogical for pre-10 versions
Ine170b8c, protection against modified search_path was added. However,PostgreSQL versions prior to 10 does not accept SQL commands over areplication connection, so the protection would generate a syntax error.Since we cannot run SQL commands on it, we are also not vulnerable tothe issue thate170b8c fixes, so we can just skip this command forolder versions.Author: Michael Paquier <michael@paquier.xyz>
1 parent5917297 commit59743de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/bin/pg_basebackup/streamutil.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,13 @@ GetConnection(void)
209209
if (conn_opts)
210210
PQconninfoFree(conn_opts);
211211

212-
/* Set always-secure search path, so malicious users can't get control. */
213-
if (dbname!=NULL)
212+
/*
213+
* Set always-secure search path, so malicious users can't get control.
214+
* The capacity to run normal SQL queries was added in PostgreSQL
215+
* 10, so the search path cannot be changed (by us or attackers) on
216+
* earlier versions.
217+
*/
218+
if (dbname!=NULL&&PQserverVersion(conn) >=100000)
214219
{
215220
PGresult*res;
216221

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp