pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Remove one use of IDENT_USERNAME_MAX
Date: Tue, 29 Oct 2019 08:10:28 +0100
Message-ID: <eedd3c43-ed87-3c84-de36-07a83ca94265@2ndquadrant.com> (raw)
In-Reply-To: <14311.1572270354@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>

On 2019-10-28 14:45, Tom Lane wrote:
> 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?

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.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (6+ messages)  latest in thread

Message-ID: <eedd3c43-ed87-3c84-de36-07a83ca94265@2ndquadrant.com>
Permalink:  ../eedd3c43-ed87-3c84-de36-07a83ca94265@2ndquadrant.com/
Also on:    postgresql.org/message-id/eedd3c43-ed87-3c84-de36-07a83ca94265@2ndquadrant.com

 · 

reply

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: <eedd3c43-ed87-3c84-de36-07a83ca94265@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