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 1luK81-0000ut-FB for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Jun 2021 19:26:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luK7z-00086R-1I for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Jun 2021 19:26:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luK7y-00086I-Qd for pgsql-bugs@lists.postgresql.org; Fri, 18 Jun 2021 19:26:06 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luK7t-0000QD-Fp for pgsql-bugs@lists.postgresql.org; Fri, 18 Jun 2021 19:26:05 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D59315C00AF; Fri, 18 Jun 2021 15:25:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 18 Jun 2021 15:25:59 -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:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=M0tY1b3ApGvHbtfNNca3BDbm96RytmYETTH8TBa+jm8=; b=SkFaFKqC kWnyeJchrasiKPcsvmBN+NIn0wdCDvDY+SnOO6MTj5VL2A1oCy65uoMa5T8r7uQV 4g/ijzoz9DufFzlVmg+/zC7h4tCzf9soS5xqqK0AAhPKg6LxSvraR3705fDfvo8V nUMPXZk7lsJ1bVPx/wcHM9P2vx72043NKb5UdeHJUrmITTzE/JNoI9/JLJtSMO58 oMXmxEA8eas6oJywIIwYI0G1qRliK0rPHuN/iu9pkuXaHeYzglDkWVrClWEiOhjF OEPESoSZcJihQsi0X17jrTNsowCUZ4z2v7TIA3LyuetGGIdcar3LnMOnn4AdIi1L tDkkYKDs7GwrGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeeffedgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepledvgfffvedvieeukeekjedvtdefteeuieejtedtgfeh leefieefueetleduveeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Jun 2021 15:25:58 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id A48CB2A07DE; Fri, 18 Jun 2021 15:25:55 -0400 (-04) Date: Fri, 18 Jun 2021 15:25:55 -0400 From: Alvaro Herrera To: Stephen Frost Cc: Tom Lane , Michael Paquier , exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17062: Assert failed in RemoveRoleFromObjectPolicy() on DROP OWNED policy applied to duplicate role Message-ID: <202106181925.x6ka3pktyblk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jun-18, Stephen Frost wrote: > > But shouldn't DROP OWNED BY clean those out for you? If you've got > > the right to get rid of the role, ISTM that that should certainly > > include the right to get rid of grants to it. > > Ah, yes, I misunderstood what was being suggested … ideally it would just > remove the role from the set and not blow away the entire policy though, > but then that gets to the point about a NONE option as you suggested since > you certainly wouldn’t want that policy to suddenly be as if it was > declared for PUBLIC. Could you just set the policy to be granted to "only the bootstrap superuser" in that case? I mean as an implementation path for back branches; use NONE going forward. That would make the policy allow nobody who can't already access the record, instead of falling back to PUBLIC -- which I agree seems suboptimal security-wise. > Hrmpf. Makes it a bit awkward as you wouldn’t know, afterwards, what role > that policy HAD been for though. Perhaps just letting it be removed in > such a case is the better option, if it’s the only role remaining. That > would be in line with the GRANT system- it’s not like you can review what > ACLs a role had been given after a DROP OWNED BY has been run. Yeah, I think if you really wanted to keep track of changes, you would have an auditing system that records them. Pity you can't build one with event triggers (because these don't work for global objects). -- Álvaro Herrera 39°49'30"S 73°17'W "No hay hombre que no aspire a la plenitud, es decir, la suma de experiencias de que un hombre es capaz"