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 1oDuyb-0004ym-0E for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jul 2022 21:41:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDuyZ-0005v6-JW for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Jul 2022 21:41:55 +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 1oDuyZ-0005ux-8u for pgsql-hackers@lists.postgresql.org; Tue, 19 Jul 2022 21:41:55 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oDuyS-00058b-Dq for pgsql-hackers@postgresql.org; Tue, 19 Jul 2022 21:41:54 +0000 Received: by mail-qt1-x82a.google.com with SMTP id l14so9743564qtv.4 for ; Tue, 19 Jul 2022 14:41:47 -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=idYcz2kOQCnjP0Tw2MXleMrjIy0whpxZdZKkuZq6APU=; b=dooiiw4PIvYVXzPJbjPIf4Ri9hIy3K/QGf0f/KDpAQhmqvJx7d6JPJ9Oyvu+RFzmLi +GHYmTfYQ3f/DipdjpGRksKSfS+gHICMTldUfJ5U2q78f3B0PaSztPiQtPXwUEeezyvi dztWj0j9TragitUGUO9ze7viLPjRtJW+TgR2Ohga/jMBMXohoxVSRL6+Wm3AofUXKnwQ RijnNkmH+KhS63iW46hb7DnWhJ4zC35AWT6gZd8ZHtLhtsFpuLskowbyPm3ZkIPUt1Qx PFq4YgZlp1WfqvoNhn7HiuaT+Ga0QSWr/Mrv0O4G/kUifC/xJ9ow6c2aAGFpRad1haSu +dqA== 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=idYcz2kOQCnjP0Tw2MXleMrjIy0whpxZdZKkuZq6APU=; b=3D+YFYscWUf3rMuYL1jWMoVw2XN0pfxvGLbwizByK0Hpgcmoq8ZsbijfSyggBQOIBd l7/eYAVjXXwiKMZESlqGD9KALEgkRbebBhqqpNxJRJZoCTs+gCE6XWZrnoEzs7s1ZqYT eNeByqdMgdx50cCfEOdnBpg0FaJpWXxsq78Z/hHm4izw4QBO+aZ02MOtKJG78YQNv4Jo L5mUrLbXpbgzYn/B0ip0v2HcTD+k8OS73V5HOxrjOSWPqnyxm4ln+NM6exrUpRZYTN9l LEQeFzQoViwsXGID4H2D/TgQkaOFe2AKKGQd/D1P05elolCLpUhbqP17G+tj3sdKxWc2 Emqg== X-Gm-Message-State: AJIora87SbP1gTmUn38DJFG/aK8z5C1pClQO8O+AH3c8mqhrGsYPgDwb z5TufBvG22hzQeqoh264pAUAi60fdJ4= X-Google-Smtp-Source: AGRyM1tLVcckAuIBgAAJtMer+SWsJHIJYqexYaXOw6B2pV9DzEInA+SI/H6snAuLQCEChuxxpjbvhw== X-Received: by 2002:ac8:7e87:0:b0:318:21ef:8fd9 with SMTP id w7-20020ac87e87000000b0031821ef8fd9mr26054798qtj.608.1658266906517; Tue, 19 Jul 2022 14:41:46 -0700 (PDT) Received: from nathanxps13 ([50.216.92.213]) by smtp.gmail.com with ESMTPSA id 67-20020aed30c9000000b0031ea2328edcsm11324847qtf.82.2022.07.19.14.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 14:41:46 -0700 (PDT) Date: Tue, 19 Jul 2022 14:41:42 -0700 From: Nathan Bossart To: Tom Lane Cc: Michael Paquier , pgsql-hackers@postgresql.org Subject: Re: pg_parameter_aclcheck() and trusted extensions Message-ID: <20220719214142.GA3720087@nathanxps13> References: <20220706224727.GA2158260@nathanxps13> <2995921.1657212060@sss.pgh.pa.us> <3126292.1657828950@sss.pgh.pa.us> <20220714215225.GA3173833@nathanxps13> <3159281.1657836225@sss.pgh.pa.us> <20220714225735.GB3173833@nathanxps13> <20220718215649.GA3699123@nathanxps13> <1356977.1658262428@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1356977.1658262428@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jul 19, 2022 at 04:27:08PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> However, I wonder if a >> better way to fix this is to provide a way to stop set_config_option() from >> throwing errors (e.g., setting elevel to -1). That way, we could remove >> the manual permissions checks in favor of always using the real ones, which >> might help prevent similar bugs in the future. > > I thought about that for a bit. You could almost do it today if you > passed elevel == DEBUG5; the ensuing log chatter for failures would be > down in the noise compared to everything else you would see with > min_messages cranked down that far. However, > > (1) As things stand, set_config_option()'s result does not distinguish > no-permissions failures from other problems, so we'd need some rejiggering > of its API anyway. > > (2) As you mused upthread, it's possible that ACL_SET isn't what we should > be checking here, but some more-specific privilege. So I'd just as soon > keep this privilege check separate from set_config_option's. I think we'd also need to keep the manual permissions checks for placeholders, so it wouldn't save much, anyway. > I'll push ahead with fixing it like this. Sounds good. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com