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 1taAZq-00Gw46-6Y for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 09:29:44 +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 1taAZo-00Dm7D-CS for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 09:29:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1taAZn-00Dm75-T3 for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 09:29:40 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taAZk-000hun-1a for pgsql-hackers@postgresql.org; Tue, 21 Jan 2025 09:29:39 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id D16381DA285 for ; Tue, 21 Jan 2025 10:29:33 +0100 (CET) Received: from s934.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id B893D1D907D; Tue, 21 Jan 2025 10:29:33 +0100 (CET) Received: from s470.loopia.se (unknown [172.22.191.6]) by s934.loopia.se (Postfix) with ESMTP id B62FE7CEA75; Tue, 21 Jan 2025 10:29:33 +0100 (CET) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s470.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s980.loopia.se ([172.22.191.6]) by s470.loopia.se (s470.loopia.se [172.22.190.34]) (amavisd-new, port 10024) with LMTP id aLrtUj5EJLEk; Tue, 21 Jan 2025 10:29:33 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id 2FEA2220165A; Tue, 21 Jan 2025 10:29:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1737451773; bh=WhJE4bM+wVeXXXgRWFJI39AEmiSpDTPGoDLNIbPCcJo=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Qx9x4xJEqWmi9jJ8c7+G216LJ//CiY75cagV8NW1p1rdJhVb0A5/z8wPkpGDGLNWm MJJHwARKkWs1HMzsXnBX3Xu7Xw1XIotz1BpTicvX0rEcVmEO+kK86YmcpvGYCvR450 FmuWkCyL6+EKV6o+iNx0Qds6BmJ8KcdMbWFX2ZFLsJS1DYgiW0NzJv+DFBVqKqPeFI O0W3xuTMbxn8RE0h/Mc6maZ8WZp6nH3jbtdbtQCnJLsG8JRkBQN/5Wx9m/x7ynpLHw PXTScP9K8wp3dEN9elQt95GDc8UpzSqKNPGMx4VUM/AUcr8D7DbguvnalfzSRNqtVl nx/0tJHRXjH7Q== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER From: Daniel Gustafsson In-Reply-To: Date: Tue, 21 Jan 2025 10:29:22 +0100 Cc: Peter Eisentraut , Antonin Houska , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <39A09EC8-2D72-4130-8C3E-8F3D1CC69A12@yesql.se> References: <6bde5f56-9e7a-4148-b81c-eb6532cb3651@eisentraut.org> <9B417838-B872-453D-BBFB-99FA957EB723@yesql.se> <54c008ad-1c23-47d8-ba6c-bed98a39c31c@eisentraut.org> <06102deb-00ef-431d-a3ea-65afb246700a@eisentraut.org> To: Jacob Champion X-Mailer: Apple Mail (2.3776.700.51.11.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 21 Jan 2025, at 01:40, Jacob Champion = wrote: > On Mon, Jan 20, 2025 at 2:10=E2=80=AFPM Daniel Gustafsson = wrote: >> + /* Done. Tear down the async implementation. */ >> + conn->cleanup_async_auth(conn); >> + conn->cleanup_async_auth =3D NULL; >> + Assert(conn->altsock =3D=3D PGINVALID_SOCKET); >> In pqDropConnection() we set ->altsock to NULL >=20 > (I assume you mean PGINVALID_SOCKET?) Doh, yes. >> just to be sure rather than >> assert that cleanup has done so. Shouldn't we be consistent in the >> expectation and set to NULL here as well? >=20 > I'm not opposed; I just figured that the following code might be a bit > confusing: >=20 > Assert(conn->altsock =3D=3D PGINVALID_SOCKET); > conn->altsock =3D PGINVALID_SOCKET; >=20 > But I can add a comment to the assignment to try to explain. I don't > know what the likelihood of landing code that trips that assertion is, > but an explicit assignment would at least stop problems from > cascading. It is weird, but stopping the escalation of a problem seems important. > On 21 Jan 2025, at 01:43, Jacob Champion = wrote: >=20 > On second thought, I can just fail the connection if this happens. Yeah, I think that's the best option here. -- Daniel Gustafsson