Move permissions check from do_pg_start_backup to pg_start_backup

Magnus Hagander <magnus@hagander.net>

Commit: 9544cc0d657ea09d27667c8c70302b06fbe0121b
Author: Magnus Hagander <magnus@hagander.net>
Date: 2014-01-07T16:50:56Z
Releases: 9.4.0
Move permissions check from do_pg_start_backup to pg_start_backup

And the same for do_pg_stop_backup. The code in do_pg_* is not allowed
to access the catalogs. For manual base backups, the permissions
check can be handled in the calling function, and for streaming
base backups only users with the required permissions can get past
the authentication step in the first place.

Reported by Antonin Houska, diagnosed by Andres Freund

Files

PathChange+/−
src/backend/access/transam/xlog.c modified +6 −10
src/backend/access/transam/xlogfuncs.c modified +10 −0