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 1o9WQ6-00051P-PG for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jul 2022 18:40:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o9WQ5-0008Cz-F9 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jul 2022 18:40:09 +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 1o9WQ5-0008Cp-6d for pgsql-hackers@lists.postgresql.org; Thu, 07 Jul 2022 18:40:09 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o9WQ2-0007FU-JS for pgsql-hackers@postgresql.org; Thu, 07 Jul 2022 18:40:08 +0000 Received: by mail-oi1-x229.google.com with SMTP id t189so24400855oie.8 for ; Thu, 07 Jul 2022 11:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tvKDe85wV+mj8SueeS5pHAjtqYRbpUl9Hq1rGDow8pY=; b=F7wyZQU2WR6O4LIQc5ED9n5LClr8lWMtvun8+S3smedbTxFpO2RBcwRq7UzZz4gg61 PNxeDVsq5HD3KakcnnJc75TrwK8GPFreneKbBVJsfW5cPgxklOlxmlCY2qrAE/lnK9Ul 5W2yrxJ07z+BXwOTub2NWCzV6/NbL1CtECWJdfsEto7JSjgkkVGFho4+bNz+CMpdlK9f H5N1cp7vsC+xrTQ9xyuj15da0TVJvPzXRUQCQf/gg6NddNtRHG0Uuh6K7eOQP63qI029 JWH9dDppucB9Bx66y1OT2/J/6KbmjpwHJVf/2gGFnGJFpLMeMlkaRv5rsmABN3YYTATA 3TpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tvKDe85wV+mj8SueeS5pHAjtqYRbpUl9Hq1rGDow8pY=; b=Bc4ERqj7BWOtRy4X37AahP+zeKx9W9LOztRLRhCKuPystOg6lzE3o0Oh1rzqqy9u2F zjqPiMtvjrVQ8N8/muw8shq6DbA3fk5EaUgvz9mo6zwX6rrvlDXsq6Oi+cxZy3MTl68G tw1BSyaE9t4/dKbJscDAbgqjsVuUnEfBhFePz6H3WTrmI9blVagsv/L8dbk4irXaFI1J RctVOrucFtWbYTbuFZ2RAFRH4cyTfDWr4mms/zsHyOiwAId7W2rGon0hiWDeZnBbiVwm vkpMRKd8KoHStaP8Xq8sNS/dMCQ6uyqqI03nMjhMFX4blnYDHl7d7jgCUE0TQVz5dNYe MTYw== X-Gm-Message-State: AJIora+4XZUsvbjlWhWXt8LaIqwK5ti/aOSX/JE2ArRIYzvVm+GvypNL jcOrhpw4kyBlg9Ox31dxOk8= X-Google-Smtp-Source: AGRyM1vENHw+LABrw+duePWPS5PHjpTMN7R3rSv86bF9wP1tYP4fPuxXufvqDjeofCdRotnFTYROVw== X-Received: by 2002:a05:6808:16a3:b0:326:a585:95b8 with SMTP id bb35-20020a05680816a300b00326a58595b8mr3336966oib.281.1657219205797; Thu, 07 Jul 2022 11:40:05 -0700 (PDT) Received: from nathanxps13 ([2600:380:c031:4fe1:d651:22c1:b379:2660]) by smtp.gmail.com with ESMTPSA id j26-20020a9d191a000000b0061c257b18b7sm29865ota.80.2022.07.07.11.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 11:40:05 -0700 (PDT) Date: Thu, 7 Jul 2022 11:40:01 -0700 From: Nathan Bossart To: Tom Lane Cc: Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: pg_parameter_aclcheck() and trusted extensions Message-ID: <20220707184001.GA2255643@nathanxps13> References: <20220706224727.GA2158260@nathanxps13> <2995921.1657212060@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2995921.1657212060@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 07, 2022 at 12:41:00PM -0400, Tom Lane wrote: > Yeah. So the fix here seems pretty obvious: rather than applying the > permissions check using bare GetUserId(), we need to remember the role > OID that originally applied the setting, and use that. Please ignore my previous message. This makes sense. > The problem with this sketch is that > > (1) we need an OID field in struct config_generic, as well as GucStack, > which means an ABI break for any extensions that look directly at GUC > records. There probably aren't many, but ... > > (2) we need an additional parameter to set_config_option, which > again is a compatibility break for anything calling that directly. > There surely are such callers --- our own extensions do it. > > Can we get away with doing these things in beta3? We could avoid > breaking (2) in the v15 branch by making set_config_option into > a wrapper around set_config_option_ext, or something like that; > but the problem with struct config_generic seems inescapable. > (Putting the new field at the end would solve nothing, since > config_generic is embedded into larger structs.) > > The alternative to API/ABI breaks seems to be to revert the > feature, which would be sad. I personally lean more towards the compatibility break than reverting the feature. There are still a couple of months before 15.0, and I suspect it won't be too difficult to fix any extensions that break because of this. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com