Re: Remove line length restriction in passwordFromFile()
Fujii Masao <masao.fujii@oss.nttdata.com>
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>
Date: 2020-09-09T16:34:48Z
Lists: pgsql-hackers
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
Commits
-
Teach libpq to handle arbitrary-length lines in .pgpass files.
- df8020b329eb 11.10 landed
- ba23174dd916 9.6.20 landed
- b55b4dad99e9 14.0 landed
- 8d486cfbf249 9.5.24 landed
- 55aea0c706ca 12.5 landed
- 4178b749963c 13.0 landed
- 0c0a3a8591d8 10.15 landed
-
Fix issues around .pgpass file.
- 2eb3bc58814f 13.0 cited