diff options
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 190d86b7529..1e8bb8bbc69 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -9412,6 +9412,9 @@ issue_xlog_fsync(int fd, uint32 log, uint32 seg) * * Every successfully started non-exclusive backup must be stopped by calling * do_pg_stop_backup() or do_pg_abort_backup(). + * + * It is the responsibility of the caller of this function to verify the + * permissions of the calling user! */ XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast, char **labelfile) @@ -9431,11 +9434,6 @@ do_pg_start_backup(const char *backupidstr, bool fast, char **labelfile) backup_started_in_recovery = RecoveryInProgress(); - if (!superuser() && !has_rolreplication(GetUserId())) - ereport(ERROR, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("must be superuser or replication role to run a backup"))); - /* * Currently only non-exclusive backup can be taken during recovery. */ @@ -9731,6 +9729,9 @@ pg_start_backup_callback(int code, Datum arg) * If labelfile is NULL, this stops an exclusive backup. Otherwise this stops * the non-exclusive backup specified by 'labelfile'. + * + * It is the responsibility of the caller of this function to verify the + * permissions of the calling user! */ XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive) @@ -9761,11 +9762,6 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive) backup_started_in_recovery = RecoveryInProgress(); - if (!superuser() && !has_rolreplication(GetUserId())) - ereport(ERROR, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser or replication role to run a backup")))); - /* * Currently only non-exclusive backup can be taken during recovery. */ |