<div dir="ltr">Thanks Bo Peng. <div><br></div><div>Ishii-san,</div><div></div><div>Can you please move following to DONE in TODO wiki.</div><div><i style="color:rgb(0,0,0);white-space:pre-wrap"><a href="https://pgpool.net/mediawiki/index.php/TODO#Add_support_for_an_user/password_input_file_to_pg_md5">https://pgpool.net/mediawiki/index.php/TODO#Add_support_for_an_user/password_input_file_to_pg_md5</a></i><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Thanks<br>Umar Hayat<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 7, 2020 at 7:53 AM Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp">pengbo@sraoss.co.jp</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank you.<br>
<br>
Patch is committed.<br>
<a href="https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=68d66a66f55099d7ef2fdf0e7fb48ba6577e98c3" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=68d66a66f55099d7ef2fdf0e7fb48ba6577e98c3</a><br>
<br>
On Mon, 30 Mar 2020 17:14:12 +0500<br>
Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi Usama,<br>
&gt; Any feedback ?<br>
&gt; <br>
&gt; On Thu, Mar 19, 2020 at 7:07 AM Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt; wrote:<br>
&gt; <br>
&gt; &gt; Hello,<br>
&gt; &gt;<br>
&gt; &gt; On Wed, 18 Mar 2020 11:51:05 +0500<br>
&gt; &gt; Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt; Please updated patch based on feedback from Tatsu Ishii on pg_enc patch.<br>
&gt; &gt;<br>
&gt; &gt; I tested your patch and it works fine.<br>
&gt; &gt;<br>
&gt; &gt; Usama,<br>
&gt; &gt;<br>
&gt; &gt; If you don&#39;t have any feedback, I am going to update<br>
&gt; &gt; the patch based on Ishii-san&#39;s feedback and commit it.<br>
&gt; &gt;<br>
&gt; &gt; &gt; Regards<br>
&gt; &gt; &gt; Umar Hayat<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Tue, Mar 10, 2020 at 3:39 PM Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Any further updated needed for this patch from my end?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Regards<br>
&gt; &gt; &gt; &gt; Umar Hayat<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Thu, Mar 5, 2020 at 1:45 AM Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt; Hi Usama,<br>
&gt; &gt; &gt; &gt;&gt; Thanks for feedback, updated patch is attached.<br>
&gt; &gt; &gt; &gt;&gt; Please see comments inline.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Regards<br>
&gt; &gt; &gt; &gt;&gt; Umar Hayat<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; On Wed, Mar 4, 2020 at 8:05 PM Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Hi Umar,<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Here are some of the comments on your patch on top of Peng&#39;s<br>
&gt; &gt; comments.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; 1- The patch breaks the -f short option, by removing the : (colon)<br>
&gt; &gt; after<br>
&gt; &gt; &gt; &gt;&gt;&gt; f from the optstring argument to getopt_long function<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; i.e<br>
&gt; &gt; &gt; &gt;&gt;&gt; while ((opt = getopt_long(argc, argv, &quot;hpmfi:u:&quot;, long_options,<br>
&gt; &gt; &gt; &gt;&gt;&gt; &amp;optindex)) != -1)<br>
&gt; &gt; &gt; &gt;&gt;&gt; should be<br>
&gt; &gt; &gt; &gt;&gt;&gt; while ((opt = getopt_long(argc, argv, &quot;hpmf:i:u:&quot;, long_options,<br>
&gt; &gt; &gt; &gt;&gt;&gt; &amp;optindex)) != -1)<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; Fixed.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; 2- The input file has no option to specify escape characters. For<br>
&gt; &gt; &gt; &gt;&gt;&gt; example, there is no way to specify a user name or password<br>
&gt; &gt; &gt; &gt;&gt;&gt; in the input file that contains : (colon)<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt; It does handle colon in password as it consider only left most colon<br>
&gt; &gt; as<br>
&gt; &gt; &gt; &gt;&gt; separator. For example for pair like &#39;user:pass:word&#39;, user name will<br>
&gt; &gt; be<br>
&gt; &gt; &gt; &gt;&gt; &#39;user&#39; and password will be &#39;pass:word&#39;<br>
&gt; &gt; &gt; &gt;&gt; I am not sure user name with colon is valid scenario? If its true, we<br>
&gt; &gt; can<br>
&gt; &gt; &gt; &gt;&gt; add a note otherwise IMO there could be ton of negative scenarios.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; 3- Specifying the input file disregards the &quot;-m&quot; &quot;--md5auth&quot; option<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Fixed. That was purposefully disregarded  previously as mention<br>
&gt; &gt; &gt; &gt;&gt; in mentisbt-422, input-file mode as only for md5auth.<br>
&gt; &gt; &gt; &gt;&gt; Now It honour -m flag and in absence of this it will print md5 value<br>
&gt; &gt; &gt; &gt;&gt; stdout.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; 4- The patch is not considering the length of username and password<br>
&gt; &gt; &gt; &gt;&gt;&gt; buffers while copying into them<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; +               strncpy(username, buf, pch-buf);<br>
&gt; &gt; &gt; &gt;&gt;&gt; +               strncpy(password, pch+1, strlen(pch+1));<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; The len (3rd) argument of strncpy is intended to guard against the<br>
&gt; &gt; &gt; &gt;&gt;&gt; buffer overflow of the destination string.<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Fixed.<br>
&gt; &gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; Thanks<br>
&gt; &gt; &gt; &gt;&gt;&gt; Best regards<br>
&gt; &gt; &gt; &gt;&gt;&gt; Muhammad Usama<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; On Wed, Mar 4, 2020 at 11:03 AM Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; Hi Bo Peng,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; Please find updated patch with following changes.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; 1. Trailing whitespaces warning removed<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; 2. Documentation added in &quot;doc/src/sgml/ref/pg_md5.sgml&quot; with<br>
&gt; &gt; options<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; update and example usage.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; Regards,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; Umar Hayat<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; On Wed, Mar 4, 2020 at 7:40 AM Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; hello,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; On Tue, 3 Mar 2020 14:13:33 +0500<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; Hi Bo Peng,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; Any feedback, If this looks ok to you? I should send the same for<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; pg_enc<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; utility.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; Sorry for late response.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; First, when I apply this patch, I found some extra trailing spaces.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; -----------------<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; $ git apply pg_md5_input_file.diff<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; pg_md5_input_file.diff:85: trailing whitespace.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; static void<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; warning: 1 line adds whitespace errors.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; -----------------<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; Could you add documentation in &quot;doc/src/sgml/ref/pg_md5.sgml&quot; to<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; explain how to use this option?<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; Regards<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; Umar Hayat<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; Principal Software Engineer<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; EnterpriseDB: <a href="https://www.enterprisedb.com" rel="noreferrer" target="_blank">https://www.enterprisedb.com</a><br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; On Thu, Feb 13, 2020 at 9:54 AM Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; Thank you for your patch.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; I will review your patch.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; On Tue, 11 Feb 2020 16:45:50 +0500<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; Umar Hayat &lt;<a href="mailto:m.umarkiani@gmail.com" target="_blank">m.umarkiani@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; Hello Hackers,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; I saw &quot;Add support for an user/password input file to pg_md5&quot;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; enhancement<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; in PgPool-II TODO list<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; &lt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; <a href="https://pgpool.net/mediawiki/index.php/TODO#Add_support_for_an_user/password_input_file_to_pg_md5" rel="noreferrer" target="_blank">https://pgpool.net/mediawiki/index.php/TODO#Add_support_for_an_user/password_input_file_to_pg_md5</a><br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt;,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; (mentisbt-422 &lt;<br>
&gt; &gt; <a href="https://www.pgpool.net/mantisbt/view.php?id=422" rel="noreferrer" target="_blank">https://www.pgpool.net/mantisbt/view.php?id=422</a>&gt;),<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; so I<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; implemented this in pg_md5 utility. Please find attached<br>
&gt; &gt; patch<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; for<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; enhancement.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; As suggested, a new --input-file option added in pg_md5.<br>
&gt; &gt; Using<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; this<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; option,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; pg_md5 will parse the *user:password* pairs from provide file<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; and will<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; create *user:md5xxxxxx* value in pool_passwd file.<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; Regards,<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; &gt; Umar Hayat<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt; SRA OSS, Inc. Japan<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; --<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; _______________________________________________<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; pgpool-hackers mailing list<br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; <a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
&gt; &gt; &gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt; &gt; &gt;&gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
&gt; &gt; SRA OSS, Inc. Japan<br>
&gt; &gt;<br>
<br>
<br>
-- <br>
Bo Peng &lt;<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>&gt;<br>
SRA OSS, Inc. Japan<br>
</blockquote></div>