pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: postgres_fdw: Judge password use by run-as user, not session use
3+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2017-12-05 82c5c533d1  postgres_fdw: Fix failing regression test.
* pgsql: postgres_fdw: Judge password use by run-as user, not session use
@ 2017-12-05 16:33 Robert Haas <rhaas@postgresql.org>
  2017-12-05 18:03 ` Re: pgsql: postgres_fdw: Judge password use by run-as user, not session use Stephen Frost <sfrost@snowman.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Robert Haas @ 2017-12-05 16:33 UTC (permalink / raw)
  To: pgsql-committers

postgres_fdw: Judge password use by run-as user, not session user.

This is a backward incompatibility which should be noted in the
release notes for PostgreSQL 11.

For security reasons, we require that a postgres_fdw foreign table use
password authentication when accessing a remote server, so that an
unprivileged user cannot usurp the server's credentials.  Superusers
are exempt from this requirement, because we assume they are entitled
to usurp the server's credentials or, at least, can find some other
way to do it.

But what should happen when the foreign table is accessed by a view
owned by a user different from the session user?  Is it the view owner
that must be a superuser in order to avoid the requirement of using a
password, or the session user?  Historically it was the latter, but
this requirement makes it the former instead.  This allows superusers
to delegate to other users the right to select from a foreign table
that doesn't use password authentication by creating a view over the
foreign table and handing out rights to the view.  It is also more
consistent with the idea that access to a view should use the view
owner's privileges rather than the session user's privileges.

The upshot of this change is that a superuser selecting from a view
created by a non-superuser may now get an error complaining that no
password was used, while a non-superuser selecting from a view
created by a superuser will no longer receive such an error.

No documentation changes are present in this patch because the
wording of the documentation already suggests that it works this
way.  We should perhaps adjust the documentation in the back-branches,
but that's a task for another patch.

Originally proposed by Jeff Janes, but with different semantics;
adjusted to work like this by me per discussion.

Discussion: http://postgr.es/m/CA+TgmoaY4HsVZJv5SqEjCKLDwtCTSwXzKpRftgj50wmMMBwciA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ab3f008a2dc364cf7fb75de0a691fb0c61586c8e

Modified Files
--------------
contrib/postgres_fdw/connection.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: postgres_fdw: Judge password use by run-as user, not session use
  2017-12-05 16:33 pgsql: postgres_fdw: Judge password use by run-as user, not session use Robert Haas <rhaas@postgresql.org>
@ 2017-12-05 18:03 ` Stephen Frost <sfrost@snowman.net>
  2017-12-05 18:16   ` Re: pgsql: postgres_fdw: Judge password use by run-as user, not session use Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Stephen Frost @ 2017-12-05 18:03 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers

Robert,

* Robert Haas (rhaas@postgresql.org) wrote:
> postgres_fdw: Judge password use by run-as user, not session user.

There was apparently a regression test that was broken by this and is
making the buildfarm rather unhappy..

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: postgres_fdw: Judge password use by run-as user, not session use
  2017-12-05 16:33 pgsql: postgres_fdw: Judge password use by run-as user, not session use Robert Haas <rhaas@postgresql.org>
  2017-12-05 18:03 ` Re: pgsql: postgres_fdw: Judge password use by run-as user, not session use Stephen Frost <sfrost@snowman.net>
@ 2017-12-05 18:16   ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Robert Haas @ 2017-12-05 18:16 UTC (permalink / raw)
  To: Stephen Frost <sfrost@snowman.net>; +Cc: pgsql-committers

On Tue, Dec 5, 2017 at 1:03 PM, Stephen Frost <sfrost@snowman.net> wrote:
> * Robert Haas (rhaas@postgresql.org) wrote:
>> postgres_fdw: Judge password use by run-as user, not session user.
>
> There was apparently a regression test that was broken by this and is
> making the buildfarm rather unhappy..

Oops.  Sorry.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2017-12-05 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 16:33 pgsql: postgres_fdw: Judge password use by run-as user, not session use Robert Haas <rhaas@postgresql.org>
2017-12-05 18:03 ` Stephen Frost <sfrost@snowman.net>
2017-12-05 18:16   ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox