Re: [TODO] Process pg_hba.conf keywords as case-insensitive - Mailing list pgsql-hackers
From | Kyotaro HORIGUCHI |
---|---|
Subject | Re: [TODO] Process pg_hba.conf keywords as case-insensitive |
Date | |
Msg-id | CAM103DszG729RHqKLMUgG+OX2HNTFDRpPG2Pvf8z+9V7O-Jm3A@mail.gmail.com Whole thread Raw |
In response to | Re: [TODO] Process pg_hba.conf keywords as case-insensitive (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>) |
Responses |
Re: [TODO] Process pg_hba.conf keywords as
case-insensitive
|
List | pgsql-hackers |
<p dir="ltr">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.<p dir="ltr">regards,<br /><font color="#888888">--</font><br/><font color="#888888">Kyotaro Horiguchi</font><br /><font color="#888888">NTT Open Source SoftwareCenter</font><div class="gmail_quote">2014/09/09 20:49 "Kyotaro HORIGUCHI" <<a href="mailto:horiguchi.kyotaro@lab.ntt.co.jp">horiguchi.kyotaro@lab.ntt.co.jp</a>>:<brtype="attribution" /><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, I will be thereviewer of this patch.<br /><br /> You approach that coloring tokens seems right, but you have<br /> broken the parselogic by adding your code.<br /><br /> Other than the mistakes others pointed, I found that<br /><br /> - non-SQL-identlike tokens are ignored by their token style,<br /> quoted or not, so the following line works.<br /><br />| "local" All aLL trust<br /><br /> I suppose this is not what you intended. This is because you have<br /> igonred theattribute of a token when comparing it as<br /> non-SQL-ident tokens.<br /><br /><br /> - '+' at the head of the sequence'+"' is treated as the first<br /> character of the *quoted* string. e.g. +"hoge" is tokenized as<br /> "+hoge":special_quoted.<br/><br /> This is why you simply continued processing for '+"' without<br /> discarding and skippingthe '+', and not setting in_quote so the<br /> following parser code works as it is not intended. You should<br />understand what the original code does and insert or modify<br /> logics not braeking the assumptions.<br /><br /> >> With this patch, database (and role?) names are compared case-insensitively.<br /> > > For example:<br />> ><br /> > > local MixedDB all trust<br /> > > local mixedDB all reject<br /> > ><br /> >> psql -d "mixedDB"<br /> > > psql (9.5devel)<br /> > > Type "help" for help.<br /> > ><br /> >> mixedDB=#<br /> > ><br /> > > That connection should've matched that 2nd line, and be rejected.<br />><br /> > Actually it should have matched neither, as both lines will get folded<br /> > downcase:<br /> ><br/> > local mixeddb all trust<br /> > local mixeddb all reject<br /><br /> regards,<br /><br /> --<br /> KyotaroHoriguchi<br /> NTT Open Source Software Center<br /><br /><br /> --<br /> Sent via pgsql-hackers mailing list (<ahref="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br /> To make changes to your subscription:<br/><a href="http://www.postgresql.org/mailpref/pgsql-hackers" target="_blank">http://www.postgresql.org/mailpref/pgsql-hackers</a><br/></blockquote></div>
pgsql-hackers by date: