Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wTXmv-000bAh-38 for pgsql-hackers@arkaria.postgresql.org; Sun, 31 May 2026 04:28:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wTXlu-006ohC-0g for pgsql-hackers@arkaria.postgresql.org; Sun, 31 May 2026 04:27:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wTXlt-006ogy-2i for pgsql-hackers@lists.postgresql.org; Sun, 31 May 2026 04:27:34 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wTXlr-00000000Phv-2V70 for pgsql-hackers@postgresql.org; Sun, 31 May 2026 04:27:33 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2bf22d29dabso14473195ad.2 for ; Sat, 30 May 2026 21:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780201648; x=1780806448; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eGXWp6LympHzcIEf9YDkty8Mbpv+NiAPBlBKIRlGLiw=; b=ZfVlly1qCXfzlIMHXW0LgMLpy8My7+NbfTmBQ/RWV41wGjTm664sYDg9rmWzrE+ofS D5quljYAcV5MIiufvvcxRV/Y6PLcdBJNvpsTGI9wGGB7J4Op2IzYQS1OMjZ1wMA4eDYl ouKSyOSx5Qog1/A2VqwUmSffP0BJiTMaDchlAYR6Mh8feavXGGY58EQMtiqR+hHkCofK xMO8QjgNuPrLpIj4LzXofzv3tXQ+kFUhflEfaoVdYA4bXqAee+Ca2V58psHIA+9BJuDl q5vcp7pgM3TzkrN2QDieBNXT3KbEFwmbN0YxOhzqsTtbR0wAC707/NuWegZ1pCnWnaEl XT8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780201648; x=1780806448; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eGXWp6LympHzcIEf9YDkty8Mbpv+NiAPBlBKIRlGLiw=; b=Hv7jChIxS7aLyd/Ri4rt4ay5CUUYL0arfgZca6scVr/8ifO0vsLaINRG2f5mdifyeF L3O+Bjoc1NKTzPkXokLx9etl5oyNHZjF46Tz5tp1V3+p03x3kEp4UzoC7YczmSziwP69 mefq1055S2RKkxmGA/89zMZymZm7N52LrtdiKbj2rsg8r1rSBOJofrMaOrAX3U0J4E2Q fTmwkbD2hHqH75FAI8trP2wOmlEPSpwJoZLNiz5LQFZSzGbpSB0MxW8gi9G98yBnmyvi KdbHy5gnnN+vCN2EzmTzuqyu6OuuUypAhfpWjztyP2Dmt+M+UoQeUctyCt4PwmDAikcP jY1g== X-Forwarded-Encrypted: i=1; AFNElJ83ntjuPpUiPwb17J/PuDmcVX0S0RljhgqUrIkoRVQNshcHKXryiFtotWAguaBjV/nu+njT10QLoSgM01hY@postgresql.org X-Gm-Message-State: AOJu0YxyzuEk6xjsdFlask5Bm5/EpyEvRK8BC6Ogy/ipyVhsscksAANA cLB+uRGmzF3n43IOHOCja4i+hbN2Eo4TnCpyZ4rxoxIvn7sdGsnJAjiW X-Gm-Gg: Acq92OFsXQ/hNSXi0UsoCeLSRHzLTFLfdLHudgF/EIjjCtkf8EwXJWfLRx7lTIWiSXT /htNpS+rEgJR/cjDUzUesIRGmgwbb/DefgrUWh1JW5NyNKiLZWPNmTNroqt1Z9Byw20AizJXDlX jx2oNC7LAlRSabU76kaGvZ6TwN1DMKJsMs0SRJCMn1d/R0CF5tRByt32aVb9n59GCwH0Hl23oyA crp6tX0mv1+4tgucxl+TroQGOaas6Te7yqxcIQsIkQTKClrLlR/5N4EGv6FXlMdnKb77kV1j3N5 OdJpeZvux+7XvWSYTsudfoexOqnJ3vNC2XniDojVPT6NVErwax1wj6r1Ed77EDP5OIpRtiggqm1 kUjeOrrmB4GmVH2kMlpTQP2d1rdJ0hs+FTCzrzK/35U+s99HRM/Rw9fguln1EKEIroC4Px/hXOG 51c84kOl3WLH3BDBgZyd/5tEQS0atAjzUZMyW5ILU0pA== X-Received: by 2002:a17:903:1905:b0:2b2:ec46:dfed with SMTP id d9443c01a7336-2bf368463fcmr73892205ad.31.1780201648344; Sat, 30 May 2026 21:27:28 -0700 (PDT) Received: from smtpclient.apple ([203.76.245.26]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf369c790esm42041505ad.56.2026.05.30.21.27.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 May 2026 21:27:27 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: Avoid leaking system path from pg_available_extensions From: Chao Li In-Reply-To: <5ce9de1e-0b89-4c62-ab3e-9e4513ba69b7@dunslane.net> Date: Sun, 31 May 2026 12:26:51 +0800 Cc: Matheus Alcantara , Jim Jones , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <9ABAF640-2E1D-4825-8C0D-D2FF95BBD236@gmail.com> References: <357C774A-ECE9-4455-B641-315205D4D9A1@gmail.com> <96203151-6929-4d88-85a0-d552ee258a24@gmail.com> <87c8f8ac-614b-4679-afc7-f591b76c8ff7@gmail.com> <83AF10FE-7655-43DF-A302-3CAC796B572F@gmail.com> <5ce9de1e-0b89-4c62-ab3e-9e4513ba69b7@dunslane.net> To: Andrew Dunstan X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 30, 2026, at 21:21, Andrew Dunstan wrote: >=20 >=20 > On 2026-05-26 Tu 9:29 AM, Matheus Alcantara wrote: >> On 26/05/26 04:14, Chao Li wrote: >>>=20 >>>=20 >>>> On May 22, 2026, at 23:40, Matheus Alcantara = wrote: >>>>=20 >>>> On 22/05/26 04:25, Jim Jones wrote: >>>>> On 21/05/2026 17:12, Matheus Alcantara wrote: >>>>>> I've reproduced the issue and the fix looks correct to me. >>>>> same here, +1 >>>>=20 >>>> Thank you for also testing. >>>>=20 >>>>> I was wondering if creating a constant for it would be, = stylistically >>>>> speaking, a cleaner solution. For instance: >>>>> #define EXTENSION_SYSTEM_MACRO "$system" >>>>> I realize that it's used only inside = get_extension_control_directories() >>>>> but since it is even mentioned in the docs, I guess it wouldn't be = a bad >>>>> idea. >>>>=20 >>>> I'm not against it but I don't think that it's necessary since as = you mention, only get_extension_control_directories() use. >>>>=20 >>>=20 >>> In theory, I=E2=80=99m not against the idea either. In practice, = there are many hard-coded strings in the source tree, and I=E2=80=99m = not sure where the right place would be to define this macro. >>>=20 >>> Since this string is only used in = get_extension_control_directories(), and now it is used three times, I = defined it at the beginning of the function and undefined it at the end. = Let=E2=80=99s see if there are any objections to that. >>>=20 >>> Please see the attached v2. >>>=20 >>=20 >> We have such pattern in other parts of the codebase (e.g = pg_resetwal.c), so it works for me. >>=20 >> Thanks for the patch. >>=20 >>=20 >=20 > Pushed. >=20 >=20 > cheers >=20 >=20 > andrew >=20 > -- > Andrew Dunstan > EDB: https://www.enterprisedb.com Thanks for pushing. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/