Re: initdb recommendations

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: initdb recommendations
Date: 2019-07-24 20:08:34
Message-ID: 29164e47-8dfb-4737-2a61-e67a18f847f3@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On 2019-07-22 19:40, Andres Freund wrote:
> On 2019-07-22 13:02:13 -0400, Andrew Dunstan wrote:
>> There are a few things we could do. We could force trust auth, or we
>> could add an ident map that allowed $USER to login as buildfarm. Finding
>> all the places we would need to fix that could be a fun project ...
>
> Perhaps we could actually do so automatically when the initdb invoking
> user isn't the same as the OS user? Imo that'd be generally quite
> useful, and not just for the regression tets.

It seems to me that there is something missing in our client
authentication system here.

If I'm logged in as the OS user that owns the data directory, I should
be able to log in to the database system via local socket as any user.
Because why stop me? I can just change pg_hba.conf to let me in.

That would also address this problem that when you use the initdb -U
option, the proposed default "peer" setting doesn't help you much.
Making a pg_ident.conf map automatically helps for that particular user
combination, but then not for other users. (There is no "sameuser plus
these additional mappings".)

I think we could just define that if geteuid == getpeereid, then
authentication succeeds. Possibly make that a setting if someone wants
to turn it off.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2019-07-24 20:18:34 Re: initdb recommendations
Previous Message Andrew Dunstan 2019-07-24 20:02:41 Re: initdb recommendations

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-07-24 20:18:34 Re: initdb recommendations
Previous Message Andrew Dunstan 2019-07-24 20:02:41 Re: initdb recommendations