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 1jsAzb-00072v-94 for pljava-dev@arkaria.postgresql.org; Sun, 05 Jul 2020 20:12:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jsAza-0004XU-82 for pljava-dev@arkaria.postgresql.org; Sun, 05 Jul 2020 20:12:02 +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 1jsAza-0004XJ-3T for pljava-dev@lists.postgresql.org; Sun, 05 Jul 2020 20:12:02 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jsAzX-0005XD-OV for pljava-dev@lists.postgresql.org; Sun, 05 Jul 2020 20:12:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pOQ7SZ6/dzyGWW7NjrEESMYQu8P7RGfVondOcXuBLUs=; b=fEPvURnFbLM7hNuFgnJtJYC6Fn OvxxaX8MXyJxfR2yamqGI68+q4paMIoNnenNVAM6i8IxkKOlmp6QEu3fXRd+Az91Sj1gDxzEqiNWM pmEHDwnSNTrewQ/5zOrUZWvZtkbvUSrJ2BmQ9yxGZbsTuBme5rlX91VWaDgExBbRSxrEv5P3V2jKD QQvXXkCX90jK5VtlCKf2nahvZAVdLaK4dwV0rf7Ia0O2RAQ8OayTEowWvWn8VwwfOfnGEVzSORE6G fExN8rhGBYErFJRKjWqkb1zV+sHcVsRwXReLQQRBXOXtFw9j5WWn0NJHUilEior8YLHTN/T+hkuai Mft4o2bA==; Received: from [184.19.31.139] (port=44158) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jsAzV-00DB3K-4C; Sun, 05 Jul 2020 16:11:57 -0400 Subject: Re: PL/Java new build plugin To: Kartik Ohri References: <5EFA6C22.8060006@anastigmatix.net> <5EFC18D9.3090108@anastigmatix.net> <5EFD41B1.30009@anastigmatix.net> <5EFE0A4D.8060402@anastigmatix.net> <5F0125BC.5000609@anastigmatix.net> <5F0172D7.3000708@anastigmatix.net> <5F02122C.7040905@anastigmatix.net> <5F021785.905@anastigmatix.net> <5F021A20.1050903@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F02340C.7030002@anastigmatix.net> Date: Sun, 5 Jul 2020 16:11:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 07/05/20 14:35, Kartik Ohri wrote: > Only '\r' and '\n' are not allowed in the path. Everything else should > work. Um, "not allowed" by what? Seems more like you are describing a case that is possible, but not handled by your code. As the example showed, real paths on the system are allowed to contain those characters. The limitation here is that the pg_config output will be incorrectly parsed if they do, leading probably to a mysterious PL/Java build failure, quite similar our existing issue #261, which was caused by other code assuming a directory name would never contain whitespace. Solving issue #261 will be one of the benefits of your work this summer, by ending our reliance on that other faulty code. ... which is a good reason to think hard about whether the new code should be bringing in an analogous new limitation. /In cases where there is no simple alternative/, it's acceptable to address such limits in documentation. The release notes can say something like: We fixed a problem where PL/Java wouldn't build in a directory whose name contains a space, because that turned out to be not so unusual really. At the same time, we have made things break if PostgreSQL is in a directory with newlines, because we think that's /really/ unusual and you deserve to have our build break if you do it. You especially deserve whatever happens if you name a directory something like: Hi! BINDIR=I am a sneaky directory. because we are sure that would never happen except in adversarial usage, and we don't regard building PL/Java as any kind of privileged operation that would be of interest to an adversary, so we are not using a threat model where that would matter. That can be a reasonable way of explaining implementation decisions that get made when there is no alternative that avoids the limitation, or when the only alternatives would be too much work. You can definitely browse through PL/Java's git history and find comments very much like that, explaining decisions that got made when there wasn't an easy better alternative available. But it is a lot of explaining to have to do in a situation where there is an alternative that doesn't have the problem, and not only is it easy, it is the way the code did work before you changed it. Does that make sense? --- I hope this doesn't sound unkind; it seems like you had a belief "the OS doesn't allow line separators in pathnames" that turned out not to be correct. Happens all the time. When something like that happens to me, I go through about five stages of processing it: 1. Hmm, I believed X was true and it isn't. Bummer. 2. Can I remember roughly how long I have believed X was true? 3. Have I written anything else in that time where I might have used the belief that X was true? Any of it worth going back to review or add test cases? 4. Can I remember from what source I first got the idea X was true? 5. Can I remember any other things Y, Z, ... that I learned from the same source? Would this be a good time to check Y, Z, ... also? --- The case of line separators in pathnames makes a prime example of something that is no problem as far as the core OS is concerned, but is very widely cautioned against /because/ it may often trigger failures in, ahem, userland code that makes too many assumptions. And that is a very good reason for people who are using a system, and choosing how to name things, to be cautious in that way. At the same time, it is not a good reason for people who write code to write the kind of code that makes such caution necessary. This reduces to Jon Postel's robustness principle from RFC 760, "be conservative in what you do, be liberal in what you accept from others." Regards, -Chap