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 1iPl4l-0002tV-SR for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Oct 2019 10:19:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iPl4k-0000tI-Ab for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Oct 2019 10:19:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iPl4j-0000tB-Ud for pgsql-hackers@lists.postgresql.org; Wed, 30 Oct 2019 10:19:38 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iPl4g-0007TR-2W for pgsql-hackers@postgresql.org; Wed, 30 Oct 2019 10:19:36 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B6C97210D8; Wed, 30 Oct 2019 06:19:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 30 Oct 2019 06:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=DFH4mgWSWJbCsz2mSNK3wHAdpadPqrJfMKyXU06pP Y8=; b=vlTZ7m4+VW26TLnVD0kNdevRsPNXZLQKHG96IjTWLu96m7KtxHT5FdT4y zMNcbcW48qznSEhuYgqKBS97FBYEZwZSbf3tyny9nFHhQZvYWf/yKp20TVOdEsny 0QJh9lFFfHxyHFcK3vN2F81y0B2Hl27Io624kKJi6XT+fijmDNInZbOkud9YuIt8 kXVVIrQahQQdS/HpydTdqB434Vjjo1TwuKWuQmUYxaYkBTt2dIztYQkC1o6Vsnae vK7Xvdvg2n7Z1MY8MM1aW4WBh9/GhdXE5y8H6nIB51c6eUwnZg9wazXfqHMSXvBK GcCr+TYIxQnPv/TuyiNKPcleCje4A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddtfedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhfhokffffgggjggtgfesth ejredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucffohhmrg hinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrddvgedvrddugeejrdej leenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtse dvnhguqhhurggurhgrnhhtrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from april.pezone.net (p5df2934f.dip0.t-ipconnect.de [93.242.147.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 5FE4280059; Wed, 30 Oct 2019 06:19:31 -0400 (EDT) Subject: Re: Remove one use of IDENT_USERNAME_MAX To: Tom Lane References: <20191028.141008.1808344564081861818.horikyota.ntt@gmail.com> <14311.1572270354@sss.pgh.pa.us> <13092.1572359640@sss.pgh.pa.us> Cc: Kyotaro Horiguchi , pgsql-hackers@postgresql.org From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <062cc5e1-554e-7f5d-b7ea-1d9888679680@2ndquadrant.com> Date: Wed, 30 Oct 2019 11:19:30 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <13092.1572359640@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-10-29 15:34, Tom Lane wrote: > Peter Eisentraut writes: >> On 2019-10-28 14:45, Tom Lane wrote: >>> Kyotaro Horiguchi 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