Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCogI-0000JM-RP for pgsql-admin@arkaria.postgresql.org; Mon, 31 Aug 2020 18:37:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kCogH-0007LC-QJ for pgsql-admin@arkaria.postgresql.org; Mon, 31 Aug 2020 18:37:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCogH-0007L4-Iw for pgsql-admin@lists.postgresql.org; Mon, 31 Aug 2020 18:37:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kCogF-0003rN-Fd for pgsql-admin@lists.postgresql.org; Mon, 31 Aug 2020 18:37:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 07VIbLdG4124292; Mon, 31 Aug 2020 14:37:21 -0400 From: Tom Lane To: Stephen Frost cc: Nicholas Chammas , pgsql-admin@lists.postgresql.org Subject: Re: Amazon RDS auth tokens in .pgpass In-reply-to: <20200831182505.GU29590@tamriel.snowman.net> References: <4119486.1598897040@sss.pgh.pa.us> <20200831181648.GT29590@tamriel.snowman.net> <4123590.1598898063@sss.pgh.pa.us> <20200831182505.GU29590@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Mon, 31 Aug 2020 14:25:06 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4124290.1598899041.1@sss.pgh.pa.us> Date: Mon, 31 Aug 2020 14:37:21 -0400 Message-ID: <4124291.1598899041@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> That thread does point out that passwordFromFile() is far from the >> only place that assumes passwords aren't going to be longer than >> what would be sane to enter manually. I wonder whether we need to >> worry about the other bottlenecks. > Well, as I said in that thread two years ago, seems like we should make > it work everywhere and be consistent between frontend and backend > regarding what's supported. Perhaps even clearly document what the > limit is too... In the case of passwordFromFile(), the line doesn't only contain a password. There's also a hostname that has no a-priori upper length, and some other fields too; not to mention that if we have a convention for comments then it's unfriendly to have an a-priori upper length for comment lines. So I'm thinking that the correct thing to do in passwordFromFile() is use an expansible buffer and fail only on OOM. There remains, though, the question of whether any of the other limits are problematic. regards, tom lane