From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Remove one use of IDENT_USERNAME_MAX
Date: Wed, 30 Oct 2019 11:19:30 +0100
Message-ID: <062cc5e1-554e-7f5d-b7ea-1d9888679680@2ndquadrant.com> (raw)
In-Reply-To: <13092.1572359640@sss.pgh.pa.us>
References: <c798fba5-8b71-4f27-c78e-37714037ea31@2ndquadrant.com>
<20191028.141008.1808344564081861818.horikyota.ntt@gmail.com>
<14311.1572270354@sss.pgh.pa.us>
<eedd3c43-ed87-3c84-de36-07a83ca94265@2ndquadrant.com>
<13092.1572359640@sss.pgh.pa.us>
On 2019-10-29 15:34, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>> On 2019-10-28 14:45, Tom Lane wrote:
>>> Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
>>>> In think one of the reasons for the coding is the fact that *pw is
>>>> described to be placed in the static area, which can be overwritten by
>>>> succeeding calls to getpw*() functions.
>
>>> Good point ... so maybe pstrdup instead of using a fixed-size buffer?
>
>> Maybe. Or we just decide that check_usermap() is not allowed to call
>> getpw*(). It's just a string-matching routine, so it doesn't have any
>> such business anyway.
>
> I'm okay with that as long as you add a comment describing this
> assumption.
Committed with a pstrdup(). That seemed more consistent with other code
in that file.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com
Subject: Re: Remove one use of IDENT_USERNAME_MAX
In-Reply-To: <062cc5e1-554e-7f5d-b7ea-1d9888679680@2ndquadrant.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