Re: Allow +group in pg_ident.conf

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow +group in pg_ident.conf
Date: 2023-01-09 22:33:14
Message-ID: 0186439f-b4c4-2c47-c1e5-b62fc4e2580f@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-01-09 Mo 13:24, Nathan Bossart wrote:
> On Mon, Jan 09, 2023 at 08:00:26AM -0500, Andrew Dunstan wrote:
>> + If the <replaceable>database-username</replaceable> begins with a
>> + <literal>+</literal> character, then the operating system user can login as
>> + any user belonging to that role, similarly to how user names beginning with
>> + <literal>+</literal> are treated in <literal>pg_hba.conf</literal>.
> I would ѕuggest making it clear that this means role membership and not
> privileges via INHERIT.

I've adapted a sentence from the pg_hba.conf documentation so we stay
consistent.

>> - if (case_insensitive)
>> + if (regexp_pgrole[0] == '+')
>> + {
>> + Oid roleid = get_role_oid(pg_role, true);
>> + if (is_member(roleid, regexp_pgrole +1))
>> + *found_p = true;
>> + }
>> + else if (case_insensitive)
> It looks like the is_member() check will always be case-sensitive. Should
> it respect the value of case_insensitive? If not, I think there should be
> a brief comment explaining why.

It's not really relevant. We're not comparing role names here; rather we
look up two roles and then ask if one is a member of the other. I've
added a comment.

Thanks for the review (I take it you're generally in favor).

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
ident-plus-role-v2.patch text/x-patch 4.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2023-01-09 22:38:36 Re: [PATCH] random_normal function
Previous Message Tom Lane 2023-01-09 22:30:59 Re: doc: add missing "id" attributes to extension packaging page