Thread

Commits

  1. Create memory context for tokenization after opening top-level file in hba.c

  2. Rework memory contexts in charge of HBA/ident tokenization

  1. cleanup in open_auth_file

    Ted Yu <yuzhihong@gmail.com> — 2022-11-24T00:54:58Z

    Hi,
    I was looking at the following commit:
    
    commit efc981627a723d91e86865fb363d793282e473d1
    Author: Michael Paquier <michael@paquier.xyz>
    Date:   Thu Nov 24 08:21:55 2022 +0900
    
        Rework memory contexts in charge of HBA/ident tokenization
    
    I think when the file cannot be opened, the context should be deleted.
    
    Please see attached patch.
    
    I also modified one comment where `deleted` would be more appropriate verb
    for the context.
    
    Cheers
    
  2. Re: cleanup in open_auth_file

    Ted Yu <yuzhihong@gmail.com> — 2022-11-24T01:09:22Z

    On Wed, Nov 23, 2022 at 4:54 PM Ted Yu <yuzhihong@gmail.com> wrote:
    
    > Hi,
    > I was looking at the following commit:
    >
    > commit efc981627a723d91e86865fb363d793282e473d1
    > Author: Michael Paquier <michael@paquier.xyz>
    > Date:   Thu Nov 24 08:21:55 2022 +0900
    >
    >     Rework memory contexts in charge of HBA/ident tokenization
    >
    > I think when the file cannot be opened, the context should be deleted.
    >
    > Please see attached patch.
    >
    > I also modified one comment where `deleted` would be more appropriate verb
    > for the context.
    >
    > Cheers
    >
    
    Thinking more on this.
    The context should be created when the file is successfully opened.
    
    Please take a look at patch v2.
    
  3. Re: cleanup in open_auth_file

    Michael Paquier <michael@paquier.xyz> — 2022-11-24T01:19:16Z

    On Wed, Nov 23, 2022 at 05:09:22PM -0800, Ted Yu wrote:
    > Thinking more on this.
    > The context should be created when the file is successfully opened.
    
    Indeed.  Both operations ought to be done in the reverse order, or we
    would run into leaks in the postmaster on reload if pg_ident.conf has
    been removed, for example, and this is prefectly valid.  That's what
    the previous logic did, actually.  Will fix in a minute..
    --
    Michael