Re: pgsql: Refactor code handling the names of files loaded in hba.c - Mailing list pgsql-committers

From Julien Rouhaud
Subject Re: pgsql: Refactor code handling the names of files loaded in hba.c
Date
Msg-id 20221026032730.k3sib5krgm7l6njk@jrouhaud
Whole thread Raw
In response to pgsql: Refactor code handling the names of files loaded in hba.c  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgsql: Refactor code handling the names of files loaded in hba.c
List pgsql-committers
Hi,

On Wed, Oct 26, 2022 at 02:53:08AM +0000, Michael Paquier wrote:
> Refactor code handling the names of files loaded in hba.c

For the record there is a couple of thinko in the extracted patch:

@@ -1063,6 +1064,7 @@ HbaLine *
 parse_hba_line(TokenizedAuthLine *tok_line, int elevel)
 {
    int         line_num = tok_line->line_num;
+   char       *file_name = tok_line->file_name;
    char      **err_msg = &tok_line->err_msg;
    char       *str;
    struct addrinfo *gai_result;
@@ -1077,6 +1079,7 @@ parse_hba_line(TokenizedAuthLine *tok_line, int elevel)
    HbaLine    *parsedline;

    parsedline = palloc0(sizeof(HbaLine));
+   parsedline->sourcefile = pstrdup(tok_line->file_name);

This should have used the "file_name" variable rather than accessing it via
tok_line, same for parse_ident_line.

I fixed it in the v14 sent on the main thread, unfortunately sent a bit too
late.



pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Refactor code handling the names of files loaded in hba.c
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Refactor code handling the names of files loaded in hba.c