Re: Remove line length restriction in passwordFromFile()

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Fujii Masao <fujii(at)postgresql(dot)org>
Subject: Re: Remove line length restriction in passwordFromFile()
Date: 2020-09-09 16:34:48
Message-ID: 12eff40e-80df-244e-86b8-c60b0e88bc75@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/09/02 0:14, Tom Lane wrote:
> Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-09-09 16:37:11 Re: Inconsistent Japanese name order in v13 contributors list
Previous Message Tom Lane 2020-09-09 16:26:28 Re: Minor fixes for upcoming version 13