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 1oGN35-0001Cl-MA for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 16:04:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oGN34-0005Hf-Ie for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jul 2022 16:04:42 +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 1oGN34-0005HQ-9M for pgsql-hackers@lists.postgresql.org; Tue, 26 Jul 2022 16:04:42 +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 1oGN2z-0007ay-9p for pgsql-hackers@postgresql.org; Tue, 26 Jul 2022 16:04:38 +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 26QG4XHo2361561; Tue, 26 Jul 2022 12:04:33 -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: <87edy7j1zz.fsf@wibble.ilmari.org> 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> Comments: In-reply-to =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= message dated "Tue, 26 Jul 2022 17:02:40 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2361559.1658851473.1@sss.pgh.pa.us> Date: Tue, 26 Jul 2022 12:04:33 -0400 Message-ID: <2361560.1658851473@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?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. regards, tom lane