Re: Allow replication roles to use file access functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allow replication roles to use file access functions
Date
Msg-id 22077.1441237695@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allow replication roles to use file access functions  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Allow replication roles to use file access functions  (Andres Freund <andres@anarazel.de>)
Re: Allow replication roles to use file access functions  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
> On Thu, Sep 3, 2015 at 4:52 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>> Michael Paquier wrote:
>>> The main argument for this change is that pg_rewind makes use of those
>>> functions, forcing users to use a superuser role when rewinding a
>>> node.

>> Can this piggyback on Stephen Frost's proposed patch for reserved roles et al?

> (Adding Stephen in the loop)
> I thought that this was rather independent on Stephen's default role
> patch because this is not based on a new role permission type.
> Stephen, do you think so, or should we merge the effort with your
> things?

Just on general principles, this seems like a pretty horrid idea.
To me replication privilege means the ability to transfer data out of
the master, not to cause arbitrary state changes on the master.
Therefore, "allow replication users to run pg_rewind" seems less like
a feature and more like a security bug.  Am I missing something?

Another problem with it is that access to the filesystem is about halfway
to being superuser anyway, even if it's only read-only access.  It would
certainly let you read things that one would not expect a replication
user to be able to read (like files unrelated to Postgres).

I don't entirely understand why pg_rewind should be invoking any of these
functions to begin with.  Isn't it working directly with the disk data,
with both postmasters shut down?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Memory prefetching while sequentially fetching from SortTuple array, tuplestore
Next
From: Andres Freund
Date:
Subject: Re: Allow replication roles to use file access functions