Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2nJf-0008AW-QE for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Aug 2019 02:04:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i2nJd-000359-Hd for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Aug 2019 02:04:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2nJd-000352-3Y for pgsql-hackers@lists.postgresql.org; Wed, 28 Aug 2019 02:04:05 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i2nJZ-0002Ka-R4 for pgsql-hackers@postgresql.org; Wed, 28 Aug 2019 02:04:04 +0000 Received: by mail-pf1-x442.google.com with SMTP id i30so593023pfk.9 for ; Tue, 27 Aug 2019 19:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wN7BRCOl3CfHtyfohpIptpLLHYbI26vASQEKO182uM0=; b=UT5V7wMH6bK0S1CqCksiJENfnpcyGG7PguheD8dD/FeTgmhx6xqtW7YQtLMZ+opZ2z LAiudKaJZWlSTPG7Wwq65eDmjbs3VMSJRWxh4GcX2X6Kb/ubr8nFjjFkHAw9Dyakdtna KGBMslvPl2h+KLjz+kQN5OEUfiPx2LPeFYjvoeLeBCiVHpuy8+9x9oT/YGR5yc/J6zoI kb3HRvTmNDXBEa2v131OQYWKbjUYtXy00xxWr6Bym9liWJ3cSUoMkpN1AP6r4fI68G9S LpUVGada88cOi4yD0HuqsKx4gIS374dpUkA9JIFKOauLQMpMcbJHe3mMZ1BrCaYjx7dr l5CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wN7BRCOl3CfHtyfohpIptpLLHYbI26vASQEKO182uM0=; b=mhlfreWQTYSeC+YNMRKkabc4+Ptkw8sthu9AVNoZQ5xCtXTytNXZN+8Em/Ep1mMOtz UFMmYNfcYlKib6O7qBBHXGDE5ScYOkUYlURGZY0TCEe3UDq4XThbwr3g48KsptY7anVn Q9UtDL36Tmn0VWyFGQCODjU592DTBOdsch05+heykUbriKcnU3Yi2S0gXWQUChteJ7bf GEbjfDohBtiqXaBrQceMSwQnvuZgsZvzNT7pXg4anPnkcQy18UJUlUgn/OGaC/E+6Vd3 eZFiI/2UAIwnPw9OsVpQqbhPQKYLf9VmjL++bvpXm0LlLzlK+mQBrpxFzOZBZ5nz9y0/ V7QA== X-Gm-Message-State: APjAAAXM6zvgM1DJjea/rvVTQOQM9Ujf/i1Vt4ReYh4MzD+rJXrtgy4C PEDyE3V3cFxQvSgzO/MJrlHXHqJf+0SWhkwCKu41neyoig7hPkUebPjI4gi8PZ58euEgRt34yzG ufxX1Q4oeE4nJu3G01LXu7EfNspn43swBIoZhbPlr2qXk6rRmw0NXOq/M9hwUULHhHoFyY0LAkc 1WLKBNdh3hd8E1 X-Google-Smtp-Source: APXvYqztA8c/EFkpzVqr9rXXCP1isiJU77rkLcqAYOCPjz7yjtkaRHvaRuJlzAHw7nmlThufbnJcVw== X-Received: by 2002:a17:90a:2525:: with SMTP id j34mr1812247pje.11.1566957448254; Tue, 27 Aug 2019 18:57:28 -0700 (PDT) Received: from osaka.octopusnet (p7790180-ipngn37401marunouchi.tokyo.ocn.ne.jp. [114.164.91.180]) by smtp.gmail.com with ESMTPSA id q33sm426828pja.29.2019.08.27.18.57.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2019 18:57:27 -0700 (PDT) Subject: Re: [PATCH] Make configuration file "include" directive handling more robust To: Tom Lane Cc: Kyotaro Horiguchi , pgsql-hackers@postgresql.org References: <8c8bcbca-3bd9-dc6e-8986-04a5abdef142@2ndquadrant.com> <20190717.173445.172079490.horikyota.ntt@gmail.com> <05b22e26-adb5-8193-cec5-a8ae1de0b8dc@2ndquadrant.com> <6760.1566675571@sss.pgh.pa.us> From: Ian Barwick Message-ID: <58456b7c-ff81-d020-0e9b-a64189620d5d@2ndquadrant.com> Date: Wed, 28 Aug 2019 10:57:24 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <6760.1566675571@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/25/19 4:39 AM, Tom Lane wrote: > Ian Barwick writes: >> On 7/17/19 5:34 PM, Kyotaro Horiguchi wrote:> Hello. >>>> I don't think this is new to 12. > >> No, though I'm not sure how much this would be seen as a bugfix >> and how far back it would be sensible to patch. > > I think this is worth considering as a bugfix; although I'm afraid > we can't change the signature of ParseConfigFile/ParseConfigFp in > released branches, since extensions could possibly be using those. > That limits what we can do --- but it's still possible to detect > direct recursion, which seems like enough to produce a nice error > message in typical cases. Makes sense. > I concur with Kyotaro-san that disallow-empty-include-directives.v1.patch > seems a bit brute-force, but where I would put the checks is in > ParseConfigFile and ParseConfigDirectory. > > Also, I don't agree with the goals of prevent-disallowed-includes.patch. > I'm utterly not on board with breaking use of "include" in extension > files, for instance; while that may not be documented, it works fine, > and maybe somebody out there is relying on it. I couldn't for the life of me think of any reason for using it. But if there's undocumented functionality we think someone might be using, shouldn't that be documented somewhere, if only as a note in the code to prevent its accidental removal at a later date? > Likewise, while "include" > in pg.auto.conf is not really considered supported, I don't see the > point of going out of our way to break the historical behavior. The amusing thing about that of course is that the include directive will disappear the next time ALTER SYSTEM is run and the values from the included file will appear in pg.auto.conf, which may cause some headscratching. But I guess hasn't been an actual real-world issue so far. > That leads me to propose the attached simplified patch. While I haven't > actually tried, I'm pretty sure this should back-patch without trouble. Ah, I see it's been applied already, thanks! Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services