From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: peter.eisentraut@2ndquadrant.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Remove one use of IDENT_USERNAME_MAX
Date: Mon, 28 Oct 2019 09:45:54 -0400
Message-ID: <14311.1572270354@sss.pgh.pa.us> (raw)
In-Reply-To: <20191028.141008.1808344564081861818.horikyota.ntt@gmail.com>
References: <c798fba5-8b71-4f27-c78e-37714037ea31@2ndquadrant.com>
<20191028.141008.1808344564081861818.horikyota.ntt@gmail.com>
Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
> At Sat, 26 Oct 2019 08:55:03 +0200, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote in
>> IDENT_USERNAME_MAX is the maximum length of the information returned
>> by an ident server, per RFC 1413. Using it as the buffer size in peer
>> authentication is inappropriate. It was done here because of the
>> historical relationship between peer and ident authentication. But
>> since it's also completely useless code-wise, remove it.
> 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?
regards, tom lane
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: tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, peter.eisentraut@2ndquadrant.com
Subject: Re: Remove one use of IDENT_USERNAME_MAX
In-Reply-To: <14311.1572270354@sss.pgh.pa.us>
* 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