Hi,

On Mon, Mar 28, 2022 at 04:22:32PM +0900, Michael Paquier wrote:
> On Mon, Mar 28, 2022 at 04:20:07PM +0900, Michael Paquier wrote:
> > See the attached, for reference, but it would fail with EXEC_BACKEND
> > on WIN32.
> 
> Ditto.

While working on the full regression test coverage for the file inclusion
thing, I discovered an embarrassing typo in the pg_ident_file_mapping
infrastructure, which was using the hba file name rather than the ident file
name in one of the calls.

It doesn't have much impact most of the time.  The filename is reported if
there's an IO error while reading the already opened correct file.  The real
problem is if the hba_file and ident_file are stored in different directory,
any secondary file (@filename) in the pg_ident.conf would be searched in the
wrong directory.  With the pending file inclusion patchset, the problem is
immediately visible as the view is reporting the wrong file name.

Simple fix attached.  I'll add a v15 open item shortly.
>From d36010e7fec78b3ea25255767b8a2478f85fd325 Mon Sep 17 00:00:00 2001
From: Julien Rouhaud <julien.rouh...@free.fr>
Date: Tue, 26 Jul 2022 12:52:35 +0800
Subject: [PATCH v1] Fix fill_ident_view incorrect usage of HbaFileName

Thinko introduced in a2c84990bea.

Patchpatch to 15, as the original commit.

Author: Julien Rouhaud
---
 src/backend/utils/adt/hbafuncs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/utils/adt/hbafuncs.c b/src/backend/utils/adt/hbafuncs.c
index 598259718c..9e5794071c 100644
--- a/src/backend/utils/adt/hbafuncs.c
+++ b/src/backend/utils/adt/hbafuncs.c
@@ -512,7 +512,7 @@ fill_ident_view(Tuplestorestate *tuple_store, TupleDesc 
tupdesc)
                                 errmsg("could not open usermap file \"%s\": 
%m",
                                                IdentFileName)));
 
-       linecxt = tokenize_auth_file(HbaFileName, file, &ident_lines, DEBUG3);
+       linecxt = tokenize_auth_file(IdentFileName, file, &ident_lines, DEBUG3);
        FreeFile(file);
 
        /* Now parse all the lines */
-- 
2.37.0

Reply via email to