From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: til@subnetz.org
Subject: BUG #16935: Unable to provide map= option when combining clientcert=verify-full with some auth mechanisms
Date: Sun, 21 Mar 2021 09:17:20 +0000
Message-ID: <16935-770d76934b05c85c@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 16935
Logged by: Tilman Koschnick
Email address: til@subnetz.org
PostgreSQL version: 13.2
Operating system: GNU/Linux
Description:
Dear PostgreSQL team,
I am not sure if this is actually a bug, or me misreading the documentation.
According to https://www.postgresql.org/docs/current/auth-pg-hba-conf.html,
clientcert= can be combined with any other mechanism, and when set to
"verify-full", enforces matches with "the username or an applicable
mapping". But the map= option is only allowed with some of the auth
mechanisms.
I've tried removing the limitation (see patch below), and can confirm that
with that change in place, I can combine e.g. password authentication with
clientcert=verify-full and map= options. All tests pass on the build.
Kind regards, Til
inline patch 1: postgresql-13-13.2/src/backend/libpq/hba.c (+0/-6 lines) download inline-1.patch--- postgresql-13-13.2.orig/src/backend/libpq/hba.c+++ postgresql-13-13.2/src/backend/libpq/hba.c@@ -1678,12 +1678,6 @@ parse_hba_auth_opt(char *name, char *val
if (strcmp(name, "map") == 0)
{
- if (hbaline->auth_method != uaIdent &&- hbaline->auth_method != uaPeer &&- hbaline->auth_method != uaGSS &&- hbaline->auth_method != uaSSPI &&- hbaline->auth_method != uaCert)- INVALID_AUTH_OPTION("map", gettext_noop("ident,peer, gssapi, sspi, and cert"));
hbaline->usermap = pstrdup(val);
}
else if (strcmp(name, "clientcert") == 0)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, til@subnetz.org
Subject: Re: BUG #16935: Unable to provide map= option when combining clientcert=verify-full with some auth mechanisms
In-Reply-To: <16935-770d76934b05c85c@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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