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 1oGq1c-0007LL-0g for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Jul 2022 23:01:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGq1a-00067W-T3 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Jul 2022 23:01:06 +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 1oGq1a-00067N-Jj for pgsql-hackers@lists.postgresql.org; Wed, 27 Jul 2022 23:01:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oGq1X-0005Ju-VF for pgsql-hackers@postgresql.org; Wed, 27 Jul 2022 23:01:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26RN10bm3159521; Wed, 27 Jul 2022 19:01:00 -0400 From: Tom Lane To: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= 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 In-reply-to: <2361560.1658851473@sss.pgh.pa.us> 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> <87edy7j1zz.fsf@wibble.ilmari.org> <2361560.1658851473@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 26 Jul 2022 12:04:33 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3159519.1658962860.1@sss.pgh.pa.us> Date: Wed, 27 Jul 2022 19:01:00 -0400 Message-ID: <3159520.1658962860@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: >> 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};`. > Ah. Still, libpq doesn't distinguish, so the test works anyway. > Not sure if it's worth changing. Meh ... I had to un-break the test for Windows, so did this while at it, using the local-in-block method. Thanks for the suggestion. regards, tom lane