Re: Bug in user pg_ident.conf mapping code?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Shaun Thomas <sthomas(at)optionshouse(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug in user pg_ident.conf mapping code?
Date: 2014-04-02 20:27:56
Message-ID: 533C72CC.8000506@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/02/2014 10:01 AM, Shaun Thomas wrote:
> Hey,
>
> So, I've gotten this on 9.3.4 after having a complaint from a user with
> a hyphen in his name, but I dug further.
>
> This is at the top of my pg_hba.conf file:
>
> local all all peer map=local
>
> And this is my pg_ident.conf:
>
> local dude-guy dudeguy
> local /(.*)$ \1
>
> I've reloaded configs, and even went as far as to restart the database.
> Yet the errors I get in the logs say this:
>
> 2014-04-02 10:39:59 CDT|LOG: no match in usermap "local" for user
> "dude-guy" authenticated as "dude-guy"
> 2014-04-02 10:39:59 CDT|FATAL: Peer authentication failed for user
> "dude-guy"
> 2014-04-02 10:39:59 CDT|DETAIL: Connection matched pg_hba.conf line 84:
> "local all all peer map=local"
>
> What's going on, here? Shouldn't it be checking for peer auth before
> applying the mapping? Am I missing something?

Who are you connecting as dude-guy or dudeguy?

Looks to me like:

psql -d some_db -U dude-guy

From here:

http://www.postgresql.org/docs/9.3/interactive/auth-username-maps.html

Example 19.2

If I am following you are restricting dude-guy to logging in as dudeguy.

>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shaun Thomas 2014-04-02 20:31:08 Re: SSD Drives
Previous Message Rob Sargent 2014-04-02 20:14:58 Re: COPY v. java performance comparison