<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"><<a href="mailto:singh.gurjeet@gmail.com" target="_blank">singh.gurjeet@gmail.com</a>></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'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'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"><<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>></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's<br>
great that we don'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->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->pool_passwd is the base file<br>
name of pool_passwd(can be used if you want to change standard<br>
"pool_passwd"), 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>
> Hi Gurjeet,<br>
><br>
> Sorry for delay.<br>
> I will take care of this tomorrow.<br>
> --<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>
>> Hi Tatsuo,<br>
>><br>
>> Any feedback on the correctness of the patch?<br>
>><br>
>> Thanks,<br>
>><br>
>> On Mon, Sep 26, 2011 at 10:18 PM, Gurjeet Singh <<a href="mailto:singh.gurjeet@gmail.com" target="_blank">singh.gurjeet@gmail.com</a>>wrote:<br>
>><br>
>>> Hi Tatsuo,<br>
>>><br>
>>> Please find an updated patch. I am now using strcmp() to check if we<br>
>>> need to reopne the file, just like the code in main.c, instead of comparing<br>
>>> the value with NULL.<br>
>>><br>
>>> Regards,<br>
>>><br>
>>><br>
>>> On Mon, Sep 26, 2011 at 9:57 PM, Tatsuo Ishii <<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>> wrote:<br>
>>><br>
>>>> Thanks for report and patches. I will take care of this.<br>
>>>> --<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>
>>>> > Hi,<br>
>>>> ><br>
>>>> > Maybe this is expected behaviour, but it definitely is not<br>
>>>> desirable. If<br>
>>>> > we add a new user:passwrod to the contents of pool_passwd file and send<br>
>>>> a<br>
>>>> > reload signal to pgpool, the child processes are still not able to honor<br>
>>>> the<br>
>>>> > new user and the trying to login using the new user causes error "MD5<br>
>>>> > authentication failed..."<br>
>>>> ><br>
>>>> > I have diagnosed it back to the fact that pgpool uses stdio.h<br>
>>>> interface<br>
>>>> > (FILE *) to access the pool_passwd file, and it reads the contents of<br>
>>>> the<br>
>>>> > file for every new login that requests MD5 authentication. The problem<br>
>>>> with<br>
>>>> > the stdio.h interface is that it caches the contents of the file and it<br>
>>>> does<br>
>>>> > not refresh the cache even when the contents of the file change on-disk,<br>
>>>> so<br>
>>>> > every time pgpool tries to read new user's password it does not see the<br>
>>>> new<br>
>>>> > entry and hence fails.<br>
>>>> ><br>
>>>> > To be able to connect as the new user we have to either restart<br>
>>>> pgpool<br>
>>>> > or wait for a new child to be forked which will see the new contents of<br>
>>>> the<br>
>>>> > file. All of these problems also apply to the case where we might alter<br>
>>>> the<br>
>>>> > password of an existing user and update the md5 password in pool_passwd<br>
>>>> > file.<br>
>>>> ><br>
>>>> > I have attached a minimal patch to address this issue. In the patch,<br>
>>>> we<br>
>>>> > save the file path that was initially used to open the pool_passwd and<br>
>>>> upon<br>
>>>> > every reload the child closes and reopens the file so that the stdio.h<br>
>>>> > interface does not show it cached data.<br>
>>>> ><br>
>>>> > Regards,<br>
>>>> > --<br>
>>>> > Gurjeet Singh<br>
>>>> > EnterpriseDB Corporation<br>
>>>> > The Enterprise PostgreSQL Company<br>
>>>><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Gurjeet Singh<br>
>>> EnterpriseDB Corporation<br>
>>> The Enterprise PostgreSQL Company<br>
>>><br>
>>><br>
>><br>
>><br>
>> --<br>
>> Gurjeet Singh<br>
>> EnterpriseDB Corporation<br>
>> The Enterprise PostgreSQL Company<br>
</div></div>> _______________________________________________<br>
> Pgpool-hackers mailing list<br>
> <a href="mailto:Pgpool-hackers@pgfoundry.org" target="_blank">Pgpool-hackers@pgfoundry.org</a><br>
> <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>