Re: [TODO] Process pg_hba.conf keywords as case-insensitive

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: cb(at)df7cb(dot)de
Cc: viswanatham(dot)kirankumar(at)huawei(dot)com, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [TODO] Process pg_hba.conf keywords as case-insensitive
Date: 2014-09-09 12:09:22
Message-ID: CAM103DszG729RHqKLMUgG+OX2HNTFDRpPG2Pvf8z+9V7O-Jm3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sorry for wrong suggestion. Setting in_quote is wrong there because it's
before the beginning quote. Although, advancing read pointer and replacing
c with the next value is still needed.

regards,
--
Kyotaro Horiguchi
NTT Open Source Software Center
2014/09/09 20:49 "Kyotaro HORIGUCHI" <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>:

> Hello, I will be the reviewer of this patch.
>
> You approach that coloring tokens seems right, but you have
> broken the parse logic by adding your code.
>
> Other than the mistakes others pointed, I found that
>
> - non-SQL-ident like tokens are ignored by their token style,
> quoted or not, so the following line works.
>
> | "local" All aLL trust
>
> I suppose this is not what you intended. This is because you have
> igonred the attribute of a token when comparing it as
> non-SQL-ident tokens.
>
>
> - '+' at the head of the sequence '+"' is treated as the first
> character of the *quoted* string. e.g. +"hoge" is tokenized as
> "+hoge":special_quoted.
>
> This is why you simply continued processing for '+"' without
> discarding and skipping the '+', and not setting in_quote so the
> following parser code works as it is not intended. You should
> understand what the original code does and insert or modify
> logics not braeking the assumptions.
>
> > > With this patch, database (and role?) names are compared
> case-insensitively.
> > > For example:
> > >
> > > local MixedDB all trust
> > > local mixedDB all reject
> > >
> > > psql -d "mixedDB"
> > > psql (9.5devel)
> > > Type "help" for help.
> > >
> > > mixedDB=#
> > >
> > > That connection should've matched that 2nd line, and be rejected.
> >
> > Actually it should have matched neither, as both lines will get folded
> > downcase:
> >
> > local mixeddb all trust
> > local mixeddb all reject
>
> regards,
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2014-09-09 12:35:47 Re: pgbench throttling latency limit
Previous Message didier 2014-09-09 12:07:55 Re: posix_fadvise() and pg_receivexlog