Re: Allow file inclusion in pg_hba and pg_ident files

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Allow file inclusion in pg_hba and pg_ident files
Дата
Msg-id Y1Y7L42Ln7HVMWM5@paquier.xyz
обсуждение исходный текст
Ответ на Re: Allow file inclusion in pg_hba and pg_ident files  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Allow file inclusion in pg_hba and pg_ident files
Список pgsql-hackers
On Mon, Oct 24, 2022 at 01:33:12PM +0800, Julien Rouhaud wrote:
> v12 attached, fixing multiple conflicts with recent activity.

 typedef struct TokenizedAuthLine
 {
    List       *fields;         /* List of lists of AuthTokens */
+   char       *file_name;      /* File name *

Hmm.  While putting my eyes on this patch set for the first time in a
few months (sorry!), the addition of file_name to TokenizedAuthLine in
0002 stands out.  This impacts all the macros used for the validation
of the ident and HBA lines, leading as well to a lot of bloat in the
patch with patterns like that in 20~25 places:
                 errcontext("line %d of configuration file \"%s\"", \
-                           line_num, IdentFileName))); \
+                           line_num, file_name))); \
[...]
                         errcontext("line %d of configuration file \"%s\"",
-                                   line_num, HbaFileName)));
+                                   line_num, file_name)));

Do you think that it would make sense to split that into its own
patch?  That would move the code toward less references to HbaFileName
and IdentFileName, which is one step toward what we want for this
thread.  This tokenization of HBA and ident files is already shared,
so moving this knowledge into TokenizedAuthLine looks helpful
independently of the rest.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Frédéric Yhuel
Дата:
Сообщение: Re: [PATCH] minor bug fix for pg_dump --clean
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Move backup-related code to xlogbackup.c/.h