aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2022-04-02 13:24:38 -0400
committerJoe Conway <mail@joeconway.com>2022-04-02 13:24:38 -0400
commit9752436f049430428464e22dcf837e9c6fa4e513 (patch)
tree9ce8eb15160e8237f868f379f973c5706925a49d /src
parentcfdd03f45e6afc632fbe70519250ec19167d6765 (diff)
downloadpostgresql-9752436f049430428464e22dcf837e9c6fa4e513.tar.gz
postgresql-9752436f049430428464e22dcf837e9c6fa4e513.zip
Use has_privs_for_roles for predefined role checks: round 2
Similar to commit 6198420ad, replace is_member_of_role with has_privs_for_role for predefined role access checks in recently committed basebackup code. In passing fix a double-word error in a nearby comment. Discussion: https://postgr.es/m/flat/CAGB+Vh4Zv_TvKt2tv3QNS6tUM_F_9icmuj0zjywwcgVi4PAhFA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/basebackup_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/basebackup_server.c b/src/backend/replication/basebackup_server.c
index a8786296686..bc16897b33f 100644
--- a/src/backend/replication/basebackup_server.c
+++ b/src/backend/replication/basebackup_server.c
@@ -69,10 +69,10 @@ bbsink_server_new(bbsink *next, char *pathname)
/* Replication permission is not sufficient in this case. */
StartTransactionCommand();
- if (!is_member_of_role(GetUserId(), ROLE_PG_WRITE_SERVER_FILES))
+ if (!has_privs_of_role(GetUserId(), ROLE_PG_WRITE_SERVER_FILES))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser or a member of the pg_write_server_files role to create server backup")));
+ errmsg("must be superuser or a role with privileges of the pg_write_server_files role to create server backup")));
CommitTransactionCommand();
/*