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 1oGN1K-000185-SY for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 16:02:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGN1J-0000nK-II for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 16:02:53 +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 1oGN1I-0000nB-KC for pgsql-hackers@lists.postgresql.org; Tue, 26 Jul 2022 16:02:53 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGN1G-0007aV-7H for pgsql-hackers@postgresql.org; Tue, 26 Jul 2022 16:02:51 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 917BD5C00D2; Tue, 26 Jul 2022 12:02:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 26 Jul 2022 12:02:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1658851369; x=1658937769; bh=dTGMCT8PIq D64uc4u8Ogxq8WmVQkHxzsUTUf85htFt0=; b=oqzcCprm+0YFoMCUTKkynYLviR ofNQkZTuz+yJTP0+nv/vnyL+MuUaB+raCFW+iFiVTCh4q7Y3/mEP3OfedogvSDy6 GIfYqrWIfqe8f9qVG2SSwaqv0YbGhQ/ymr2kuBK1s5HYSf/3yUMNG7Pg3qvk9NfA 12fyVoQYCUFaMW4Q2qyvUrg1GemkMyzZL4KPyZsEK5VtUA6kXXUHUnPSXyos7bW7 wEnkB3X5YYoOMdnkh5RCkikZuKrybbE3kqAQUVmjAl/VWGwOOog2vuIFl/EOjULq mAz8wvEMbTKB62JY3QLPNUBX6WONs3YBXdBnQfu+5uh/mYTi21Yz0eoFT98g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1658851369; x=1658937769; bh=dTGMCT8PIqD64uc4u8Ogxq8WmVQk HxzsUTUf85htFt0=; b=OwCoGafTi00wh0jpWSFoRCttPh3mjQx3499Fk9bONqIB FIN5pvC9LICV+Y3wEuJ9+cjQ40fBoZCbGtcmpoYySQ8aRdOKQmaEkO89cGLzTXIx k8c1TOTuRh+mCOfbcEX4ps1fk0zbfzzpHWjp8h8Ydi+NXq53vWCROk0jDCudrS1N hms3tbEjK9f3fwFxWzYKFl/tVJmT9sXJzJdQoPPY5OppiPxP3HHE7VFZAs4WjaYQ Bl6LgQkDRVoc5HAAtvg1VXFyluvfKuMRS6oowTUEqIWyZhyMjSxQp/+4pa+BeoEb uHdzkxEaHGTRSO/rETCOe26o6PA9DuCyqkHnsAYgNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddutddgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufhffjgfkfgggtgesthdtredttderjeenucfhrhhomhepffgrghhf ihhnnhgpkfhlmhgrrhhipgforghnnhhsnohkvghruceoihhlmhgrrhhisehilhhmrghrih drohhrgheqnecuggftrfgrthhtvghrnhepgeehhffhgfefteffgeduiedvueettefgleff vdehffdukeduteejiefhfeegvdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepihhlmhgrrhhisehilhhmrghrihdrohhrgh X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Jul 2022 12:02:41 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Tom Lane Cc: Nathan Bossart , Kyotaro Horiguchi , michael@paquier.xyz, gurjeet@singh.im, pgsql-hackers@postgresql.org Subject: Re: Unprivileged user can induce crash by using an SUSET param in PGOPTIONS References: <20220722.151600.1094104349120879204.horikyota.ntt@gmail.com> <729330.1658516182@sss.pgh.pa.us> <20220722223359.GB3998906@nathanxps13> <763512.1658529844@sss.pgh.pa.us> <20220722225615.GC3998906@nathanxps13> <954936.1658597004@sss.pgh.pa.us> <20220725034040.GA4085281@nathanxps13> <1834276.1658720963@sss.pgh.pa.us> <20220725043044.GC4085281@nathanxps13> <2015981.1658759562@sss.pgh.pa.us> <87ilnli57b.fsf@wibble.ilmari.org> <2062116.1658778378@sss.pgh.pa.us> Date: Tue, 26 Jul 2022 17:02:40 +0100 In-Reply-To: <2062116.1658778378@sss.pgh.pa.us> (Tom Lane's message of "Mon, 25 Jul 2022 15:46:18 -0400") Message-ID: <87edy7j1zz.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tom Lane writes: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> Tom Lane writes: >>> I wonder if it'd be a good idea to convert >>> auto_explain's TAP test to load auto_explain via session_preload_libraries >>> instead of shared_preload_libraries, and then pass in the settings for >>> each test via PGOPTIONS instead of constantly rewriting postgresql.conf. > >> That whole config-file rewriting did feel a bit icky when I added more >> tests recently, but I completely forgot about PGOPTIONS and -c. >> Something like the attached is indeed much nicer. > > Thanks! I added a test to verify the permissions-checking issue > and pushed it. Thanks! Just one minor nitpick: setting an %ENV entry to `undef` doesn't unset the environment variable, it sets it to the empty string. To unset a variable it needs to be deleted from %ENV, i.e. `delete $ENV{PGUSER};`. Alternatively, wrap the relevant tests in a block and use `local`, like in the `query_log` function. > regards, tom lane - ilmari