From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Fujii Masao <fujii@postgresql.org>
Subject: Re: Remove line length restriction in passwordFromFile()
Date: Thu, 10 Sep 2020 01:34:48 +0900
Message-ID: <12eff40e-80df-244e-86b8-c60b0e88bc75@oss.nttdata.com> (raw)
In-Reply-To: <54742.1598973287@sss.pgh.pa.us>
References: <4187382.1598909041@sss.pgh.pa.us>
<90aed8c6-a171-4cf7-4e4a-0d4d9593f6c5@oss.nttdata.com>
<b2391bb7-33c5-a25e-e99a-81f7e96efdad@oss.nttdata.com>
<54742.1598973287@sss.pgh.pa.us>
On 2020/09/02 0:14, Tom Lane wrote:
> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
>> The patch looks good to me, except the following minor thing.
>> + if (fgets(buf.data + buf.len, buf.maxlen - buf.len - 1, fp) == NULL)
>> IIUC fgets() reads the data with the specified size - 1, so ISTM that -1 of
>> "buf.maxlen - buf.len - 1" is not necessary.
>
> Good point, I was being unduly conservative. Thanks for reviewing
> the patch!
Thanks for committing the patch!
The patch was back-patched to v13, but v13 release note still has the following item.
Tighten libpq's overlength-line handling and comment detection for .pgpass files (Fujii Masao)
This should be changed to the following or something?
Teach libpq to handle arbitrary-length lines in .pgpass files (Tom Lane)
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, tgl@sss.pgh.pa.us, fujii@postgresql.org
Subject: Re: Remove line length restriction in passwordFromFile()
In-Reply-To: <12eff40e-80df-244e-86b8-c60b0e88bc75@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox