Re: pg_hba_file_settings view patch

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_hba_file_settings view patch
Date: 2017-01-30 12:51:06
Message-ID: CAJrrPGf0KDh57jWNrnYEMmC9YaiSXQ_eN4Mj1Vco+Doj8=gymg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 30, 2017 at 5:18 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Mon, Jan 30, 2017 at 11:20 AM, Haribabu Kommi
> <kommi(dot)haribabu(at)gmail(dot)com> wrote:
> > On Sun, Jan 29, 2017 at 9:18 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> tgl wrote:
> >> > I spent awhile hacking on this, and made a lot of things better, but
> >> > I'm still very unhappy about the state of the comments.
> >>
> >> I made another pass over this, working on the comments and the docs,
> >> and changing the view name to "pg_hba_file_rules". I think this version
> >> is committable if people are satisfied with that name.
>
> (catching up with this thread as a lot has happened.)
>
> > Thanks for working on the patch. I am fine with the "pg_hba_file_rules"
> > name. I have to improve in writing better comments after checking the
> > attached patch. I will improve the comments in further patch submissions
> > to community.
>
> No objections here.
>
> +/*
> + * The following character array represents the names of the
> authentication
> + * methods that are supported by PostgreSQL.
> + *
> + * Note: keep this in sync with the UserAuth enum in hba.h.
> + */
> +static const char *const UserAuthName[] =
> +{
> + "reject",
> + "implicit reject", /* Not a user-visible option */
> + "trust",
> + "ident",
> + "password",
> + "md5",
> + "gss",
> + "sspi",
> + "pam",
> + "bsd",
> + "ldap",
> + "cert",
> + "radius",
> + "peer"
> +};
> Perhaps this could use a StaticAssertStmt()? Say something like that:
> #define USER_AUTH_LAST uaPeer
> StaticAssertStmt(lengthof(UserAuthName) == USER_AUTH_LAST + 1,
> "UserAuthName must include all user authentication names");
>
> Any updates could easily be forgotten.
>

Thanks for the review. Added the static assert statement.

Updated patch attached.

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
pg_hba_rules_17.patch application/octet-stream 59.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rushabh Lathia 2017-01-30 13:01:03 wait events for disk I/O
Previous Message Alvaro Herrera 2017-01-30 12:45:07 Re: Supporting huge pages on Windows