Re: parsing pg_ident.conf

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: parsing pg_ident.conf
Date: 2020-11-20 07:19:24
Message-ID: alpine.DEB.2.22.394.2011200810170.42321@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Andrew,

> I noticed somewhat to my surprise as I was prepping the tests for the
> "match the whole DN" patch that pg_ident.conf is parsed using the same
> routines used for pg_hba.conf, and as a result the DN almost always
> needs to be quoted, because they almost all contain a comma e.g.
> "O=PGDG,OU=Testing". Even if we didn't break on commas we would probably
> need to quote most of them, because it's very common to include spaces
> e.g. "O=Acme Corp,OU=Marketing". Nevertheless it seems rather odd to
> break on commas, since nothing in the file is meant to be a list - this
> is a file with exactly three single-valued fields. Not sure if it's
> worth doing anything about this, or we should just live with it the way
> it is.

My 0.02 €:

ISTM that having to quote long strings which may contains space or other
separators is a good thing from a readability point of view, even if it
would be possible to parse it without the quotes.

So I'm in favor of keeping it that way.

Note that since 8f8154a503, continuations are allowed on "pg_hba.conf" and
"pg_ident.conf", and that you may continuate within a quoted string, which
may be of interest when considering LDAP links.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-20 07:25:13 Re: SQL-standard function body
Previous Message Kyotaro Horiguchi 2020-11-20 07:08:40 Re: Protect syscache from bloating with negative cache entries