Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uK2aB-00CFY1-GN for pgsql-bugs@arkaria.postgresql.org; Tue, 27 May 2025 22:15:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uK2a9-00Bl0F-W1 for pgsql-bugs@arkaria.postgresql.org; Tue, 27 May 2025 22:15:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uK2a9-00Bl07-NI for pgsql-bugs@lists.postgresql.org; Tue, 27 May 2025 22:15:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uK2a7-000Rc7-0M for pgsql-bugs@lists.postgresql.org; Tue, 27 May 2025 22:15:37 +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 54RMFTpq1350782; Tue, 27 May 2025 18:15:29 -0400 From: Tom Lane To: Jacob Champion cc: Chris Gooch , "pgsql-bugs@lists.postgresql.org" Subject: Re: [EXT] Re: GSS Auth issue when user member of lots of AD groups In-reply-to: References: <1529314.1747928806@sss.pgh.pa.us> <1536692.1747933034@sss.pgh.pa.us> <1647590.1747936713@sss.pgh.pa.us> <3060113.1748096813@sss.pgh.pa.us> <3125813.1748115425@sss.pgh.pa.us> Comments: In-reply-to Jacob Champion message dated "Tue, 27 May 2025 15:05:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1350780.1748384129.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 27 May 2025 18:15:29 -0400 Message-ID: <1350781.1748384129@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jacob Champion writes: > On Sat, May 24, 2025 at 12:37 PM Tom Lane wrote: >> * The backend's secure_open_gssapi allowed received initialization packets >> to be up to buffer-size long, whereas libpq will choke sending them >> if they're more than buffer-size minus sizeof(uint32). This isn't >> actually a bug, since the buffer management is handled in such a way >> that it's safe, but it seems very inconsistent. I changed the limit >> to subtract off sizeof(uint32) in all cases, which incidentally >> allowed removing one variant of the translatable message string. > That discrepancy is confusing to me. Is there a way to standardize > both sides in the other direction, so that they actually handle tokens > up to the "max size"? I don't think so, because that would create exactly the cross-version discrepancy we need to avoid. (That is, if sender thinks it can do 16384 when receiver's limit is 16384-4, kaboom.) The patch proposes to allow slop in this during the auth phase when the packet size is really being determined by the underlying GSSAPI library anyway. But once we're past that and our own code is slicing up the data stream into packets, I think the max packet size is indeed an inalterable part of the protocol. Could we address your confusion by improving the comment about the packet-size #define to point out that it includes the header word? regards, tom lane