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 1nWORJ-00040G-V5 for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 20:15:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nWORI-0003vx-PT for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 20:15:40 +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 1nWORI-0003vn-36 for pgsql-hackers@lists.postgresql.org; Mon, 21 Mar 2022 20:15:40 +0000 Received: from mail-vs1-xe29.google.com ([2607:f8b0:4864:20::e29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nWORE-0002Zw-Vp for pgsql-hackers@postgresql.org; Mon, 21 Mar 2022 20:15:39 +0000 Received: by mail-vs1-xe29.google.com with SMTP id i63so12462748vsi.5 for ; Mon, 21 Mar 2022 13:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to:content-transfer-encoding; bh=fL3Cz1tsm8DXMvD9c5ftfSwvZD66hulzC7uSzBd8Uag=; b=GybAZvbkLTGbSW9pG5pEB5Xy3VgEY8MAGNq/pYlR4RSWyCUkPHWDF+42+KAoAzFElh NyYrVMJSWGVP8va0H/vEtxB4FwxPw7P9MB09WKIhkWayecjjt7U2/cZbMVaMp9kXDtb5 YzSwgvloUc0xvW0pD779DF4DTi7C3x/K2VU2znaBuG5IWAAS1ohYLkotxDtt8hjSeCEi cpeZEUSdOJRik5dblXbBxHzWdcUaFB/IbVARn3wi1+i10KuoypAx6FshwlLkC7eA4wUK l9tqLRjy6BfrIkJ0HrwZsHr8r6ABRvUxcqe8tjKGgUTMsaLDw+mAfjk5YAKaln38BehY 7U8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=fL3Cz1tsm8DXMvD9c5ftfSwvZD66hulzC7uSzBd8Uag=; b=xVIrrt/uRV/EMFxbCkHIfxlG0xdhtoVQoeJUgkHjWvpgdDSIMMGpv2Hlzb5r5b9wBV M+8vuCqHr554GlJgfWA9LPj33DipYvQcAz04LjUlQDUjzHFNSyj9zUalXIRM69E2F5LU 8QEcFz4k8nV0Y/wfywmT7/LPB8Dmv9hkZq7lPKPzeLHVWC/rzU5r4EvJFWPmfhvJ7j4S BKZ94hpprlGBOGkY9piKXR4l+k1OrtnxUkbYE6f1BgP0ggPz6rDOcjeeH9xLivCuDeQm CNHd2l7NxTeOJhhPQIjAvPDxWkgG43gl/dNIcT8Dg7Efvtec9YRuirVoj57071zlGFqy hxzA== X-Gm-Message-State: AOAM532C1g9LPrZ/438aVL14mFLmuJKMqIV3nc/AGdJSX/ozly2zfrLl 0W2ehCbEMHYfjkPygM1PqC03KQ== X-Google-Smtp-Source: ABdhPJzqHJ4mYz8cgCoAvWL6NIHTezkfl3GiMn/ohR9iSZK8GORgcdrhaV0dWh9q0fpezdVfPAIG4Q== X-Received: by 2002:a05:6102:3906:b0:325:104c:61ad with SMTP id e6-20020a056102390600b00325104c61admr2588082vsu.29.1647893735111; Mon, 21 Mar 2022 13:15:35 -0700 (PDT) Received: from [192.168.4.41] (072-017-018-098.res.spectrum.com. [72.17.18.98]) by smtp.gmail.com with ESMTPSA id bj23-20020a0561220e5700b0033eb9e96d0bsm1475991vkb.28.2022.03.21.13.15.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Mar 2022 13:15:34 -0700 (PDT) Message-ID: <6732fdfd-0ea4-941d-fd85-331ff48af5ce@joeconway.com> Date: Mon, 21 Mar 2022 16:15:33 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Stephen Frost , Joshua Brindle Cc: "Bossart, Nathan" , Nathan Bossart , PostgreSQL-development , Robert Haas , Tom Lane References: <80af9ba7-ec24-9134-8fd9-00bf13f5c494@joeconway.com> <18eab9b6-1f77-72b2-83d3-1856c17f3fcb@joeconway.com> <0b1b6cfb-d752-28f6-7ccb-993998be0189@joeconway.com> <20220209181333.GD1627503@nathanxps13> <20220210192829.GB1684442@nathanxps13> <6135d0b7-3af9-d6fa-cdaa-990a2fc12147@joeconway.com> <744cf762-47d3-050f-5fa1-d4f9e8dbae2e@joeconway.com> From: Joe Conway Subject: Re: [PATCH v2] use has_privs_for_role for predefined roles In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/20/22 12:38, Stephen Frost wrote: > Greetings, > > On Sun, Mar 20, 2022 at 18:31 Joshua Brindle > > > wrote: > > On Sun, Mar 20, 2022 at 12:27 PM Joe Conway > wrote: > > > > On 3/3/22 11:26, Joshua Brindle wrote: > > > On Thu, Feb 10, 2022 at 2:37 PM Joe Conway > wrote: > > >> > > >> On 2/10/22 14:28, Nathan Bossart wrote: > > >> > On Wed, Feb 09, 2022 at 04:39:11PM -0500, Joe Conway wrote: > > >> >> On 2/9/22 13:13, Nathan Bossart wrote: > > >> >>> I do wonder if users find the differences between > predefined roles and role > > >> >>> attributes confusing.  INHERIT doesn't govern role > attributes, but it will > > >> >>> govern predefined roles when this patch is applied.  Maybe > the role > > >> >>> attribute system should eventually be deprecated in favor > of using > > >> >>> predefined roles for everything.  Or perhaps the > predefined roles should be > > >> >>> converted to role attributes. > > >> >> > > >> >> Yep, I was suggesting that the latter would have been > preferable to me while > > >> >> Robert seemed to prefer the former. Honestly I could be > happy with either of > > >> >> those solutions, but as I alluded to that is probably a > discussion for the > > >> >> next development cycle since I don't see us doing that big > a change in this > > >> >> one. > > >> > > > >> > I agree.  I still think Joshua's proposed patch is a > worthwhile improvement > > >> > for v15. > > >> > > >> +1 > > >> > > >> I am planning to get into it in detail this weekend. So far I have > > >> really just ensured it merges cleanly and passes make world. > > > > > > Rebased patch to apply to master attached. > > > > Well longer than I planned, but finally took a closer look. > > > > I made one minor editorial fix to Joshua's patch, rebased to current > > master, and added two missing call sites that presumably are > related to > > recent commits for pg_basebackup. > > FWIW I pinged Stephen when I saw the basebackup changes included > is_member_of and he didn't think they necessarily needed to be changed > since they aren't accessible to human and you can't SET ROLE on a > replication connection in order to access the role where inheritance > was blocked. > > Yeah, though that should really be very clearly explained in comments > around that code as anything that uses is_member should really be viewed > as an exception.  I also wouldn’t be against using has_privs there > anyway and saying that you shouldn’t be trying to connect as one role on > a replication connection and using the privs of another when you don’t > automatically inherit those rights, but on the assumption that the > committer intended is_member there because SET ROLE isn’t something one > does on replication connections, I’m alright with it being as is. Robert -- any opinion on this? If I am not mistaken it is code that you are actively working on. Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development