<div dir="ltr">I understand that this patch was committed on 2011-09-29, and pgpool 3.1 was released on 2011-09-08. So quite possibly the answer to the next question is no.<br><br>Can you please confirm if pgpool 3.1 has this fix?<br>

<br>I am assuming it is fixed in 3.2 for sure.<br><br>Just to refresh memory, I am talking about making pgpool pickup changes in pool_passwd.conf file on reload signal.<br><br>Best regards,<br><br><br><div class="gmail_extra">

<div class="gmail_quote">On Thu, Sep 29, 2011 at 8:09 AM, Gurjeet Singh <span dir="ltr">&lt;<a href="mailto:singh.gurjeet@gmail.com" target="_blank">singh.gurjeet@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks for the correcting the mistakes. Although I think the stack-frame of main() function is always available to all the functions that come after it, hence using a stack variable from that frame wouldn&#39;t have hurt, but I agree with the change because it avoids any future confusion.<br>



<br>Also, would it be possible to back-patch this to previous stable versions? As my earlier complaints, I wouldn&#39;t treat this as new feature, but a bug which always got overlooked, because SIGHUP is always supposed to reload the config files and yet password changes were never updated. My 2 cents.<br>



<br>Regards,<div><div><br><br><div class="gmail_quote">On Thu, Sep 29, 2011 at 4:47 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Gurjeet,<br>
<br>
I have committed your patches to CVS HEAD with my minor editings. It&#39;s<br>
great that we don&#39;t need to restart pgpool-II each time user changed<br>
md5 password!<br>
<br>
Here are my slight changes to original patch:<br>
<br>
- Checking pool_config-&gt;pool_passwd is not correct way to judge if we<br>
  need to reopen pool_passwd or not. Rather you should look into<br>
  enable_pool_hba. Because pool_config-&gt;pool_passwd is the base file<br>
  name of pool_passwd(can be used if you want to change standard<br>
  &quot;pool_passwd&quot;), and md5 auth is not enabled if enable_pool_hba is<br>
  off.<br>
<br>
- Storing pointer to pool_passwd path will not work since the body is<br>
  located at a stack area(char pool_passwd[POOLMAXPATHLEN+1] around<br>
  line 425 of mainc.). I modify to copy it to static memory.<br>
<br>
Chinese, French and German doc maintainer:<br>
<br>
I have modified documentation around line 3279 of<br>
pgpool-en.html. Please update other language. Thanks in advance.<br>
<div><div></div><div>--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
&gt; Hi Gurjeet,<br>
&gt;<br>
&gt; Sorry for delay.<br>
&gt; I will take care of this tomorrow.<br>
&gt; --<br>
&gt; Tatsuo Ishii<br>
&gt; SRA OSS, Inc. Japan<br>
&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;<br>
&gt;&gt; Hi Tatsuo,<br>
&gt;&gt;<br>
&gt;&gt;     Any feedback on the correctness of the patch?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Sep 26, 2011 at 10:18 PM, Gurjeet Singh &lt;<a href="mailto:singh.gurjeet@gmail.com" target="_blank">singh.gurjeet@gmail.com</a>&gt;wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi Tatsuo,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     Please find an updated patch. I am now using strcmp() to check if we<br>
&gt;&gt;&gt; need to reopne the file, just like the code in main.c, instead of comparing<br>
&gt;&gt;&gt; the value with NULL.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Regards,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Mon, Sep 26, 2011 at 9:57 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thanks for report and patches. I will take care of this.<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt;&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt;&gt;&gt; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &gt; Hi,<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;     Maybe this is expected behaviour, but it definitely is not<br>
&gt;&gt;&gt;&gt; desirable. If<br>
&gt;&gt;&gt;&gt; &gt; we add a new user:passwrod to the contents of pool_passwd file and send<br>
&gt;&gt;&gt;&gt; a<br>
&gt;&gt;&gt;&gt; &gt; reload signal to pgpool, the child processes are still not able to honor<br>
&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt; &gt; new user and the trying to login using the new user causes error &quot;MD5<br>
&gt;&gt;&gt;&gt; &gt; authentication failed...&quot;<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;     I have diagnosed it back to the fact that pgpool uses stdio.h<br>
&gt;&gt;&gt;&gt; interface<br>
&gt;&gt;&gt;&gt; &gt; (FILE *) to access the pool_passwd file, and it reads the contents of<br>
&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt; &gt; file for every new login that requests MD5 authentication. The problem<br>
&gt;&gt;&gt;&gt; with<br>
&gt;&gt;&gt;&gt; &gt; the stdio.h interface is that it caches the contents of the file and it<br>
&gt;&gt;&gt;&gt; does<br>
&gt;&gt;&gt;&gt; &gt; not refresh the cache even when the contents of the file change on-disk,<br>
&gt;&gt;&gt;&gt; so<br>
&gt;&gt;&gt;&gt; &gt; every time pgpool tries to read new user&#39;s password it does not see the<br>
&gt;&gt;&gt;&gt; new<br>
&gt;&gt;&gt;&gt; &gt; entry and hence fails.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;     To be able to connect as the new user we have to either restart<br>
&gt;&gt;&gt;&gt; pgpool<br>
&gt;&gt;&gt;&gt; &gt; or wait for a new child to be forked which will see the new contents of<br>
&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt; &gt; file. All of these problems also apply to the case where we might alter<br>
&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt; &gt; password of an existing user and update the md5 password in pool_passwd<br>
&gt;&gt;&gt;&gt; &gt; file.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt;     I have attached a minimal patch to address this issue. In the patch,<br>
&gt;&gt;&gt;&gt; we<br>
&gt;&gt;&gt;&gt; &gt; save the file path that was initially used to open the pool_passwd and<br>
&gt;&gt;&gt;&gt; upon<br>
&gt;&gt;&gt;&gt; &gt; every reload the child closes and reopens the file so that the stdio.h<br>
&gt;&gt;&gt;&gt; &gt; interface does not show it cached data.<br>
&gt;&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt;&gt; &gt; Regards,<br>
&gt;&gt;&gt;&gt; &gt; --<br>
&gt;&gt;&gt;&gt; &gt; Gurjeet Singh<br>
&gt;&gt;&gt;&gt; &gt; EnterpriseDB Corporation<br>
&gt;&gt;&gt;&gt; &gt; The Enterprise PostgreSQL Company<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Gurjeet Singh<br>
&gt;&gt;&gt; EnterpriseDB Corporation<br>
&gt;&gt;&gt; The Enterprise PostgreSQL Company<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Gurjeet Singh<br>
&gt;&gt; EnterpriseDB Corporation<br>
&gt;&gt; The Enterprise PostgreSQL Company<br>
</div></div>&gt; _______________________________________________<br>
&gt; Pgpool-hackers mailing list<br>
&gt; <a href="mailto:Pgpool-hackers@pgfoundry.org" target="_blank">Pgpool-hackers@pgfoundry.org</a><br>
&gt; <a href="http://pgfoundry.org/mailman/listinfo/pgpool-hackers" target="_blank">http://pgfoundry.org/mailman/listinfo/pgpool-hackers</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Gurjeet Singh<br>EnterpriseDB Corporation<br>The Enterprise PostgreSQL Company<br></div><br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Gurjeet Singh<br><br><a href="http://gurjeet.singh.im/" target="_blank">http://gurjeet.singh.im/</a><br></div><br>
</div></div>