Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP5LT-0001lo-U7 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Oct 2019 13:46:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iP5LS-00066s-N4 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Oct 2019 13:46:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP5LS-00066j-EJ for pgsql-hackers@lists.postgresql.org; Mon, 28 Oct 2019 13:46:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iP5LM-0003rk-Iw for pgsql-hackers@postgresql.org; Mon, 28 Oct 2019 13:46:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9SDjs8W014312; Mon, 28 Oct 2019 09:45:54 -0400 From: Tom Lane To: Kyotaro Horiguchi cc: peter.eisentraut@2ndquadrant.com, pgsql-hackers@postgresql.org Subject: Re: Remove one use of IDENT_USERNAME_MAX In-reply-to: <20191028.141008.1808344564081861818.horikyota.ntt@gmail.com> References: <20191028.141008.1808344564081861818.horikyota.ntt@gmail.com> Comments: In-reply-to Kyotaro Horiguchi message dated "Mon, 28 Oct 2019 14:10:08 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14310.1572270354.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 28 Oct 2019 09:45:54 -0400 Message-ID: <14311.1572270354@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Kyotaro Horiguchi writes: > At Sat, 26 Oct 2019 08:55:03 +0200, Peter Eisentraut 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