Re: Remove one use of IDENT_USERNAME_MAX

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove one use of IDENT_USERNAME_MAX
Date: 2019-10-30 10:19:30
Message-ID: 062cc5e1-554e-7f5d-b7ea-1d9888679680@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-10-29 15:34, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> On 2019-10-28 14:45, Tom Lane wrote:
>>> Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-10-30 12:02:07 Re: Unix-domain socket support on Windows
Previous Message Fujii Masao 2019-10-30 10:08:58 Re: pgbench - extend initialization phase control