Paul Eggert <eggert@HIDDEN>to
control <at> debbugs.gnu.org. Full text available.
Received: (at submit) by debbugs.gnu.org; 24 Apr 2021 20:04:58 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 24 16:04:58 2021 Received: from localhost ([127.0.0.1]:41544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1laOWQ-0006Tn-E0 for submit <at> debbugs.gnu.org; Sat, 24 Apr 2021 16:04:58 -0400 Received: from lists.gnu.org ([22.214.171.124]:59928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <coreutils@HIDDEN>) id 1laOWN-0006Td-Cw for submit <at> debbugs.gnu.org; Sat, 24 Apr 2021 16:04:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>) id 1laOWN-0002AF-1x; Sat, 24 Apr 2021 16:04:55 -0400 Received: from ishtar.tlinx.org ([126.96.36.199]:46636 helo=Ishtar.sc.tlinx.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <coreutils@HIDDEN>) id 1laOWK-0008Uo-Jz; Sat, 24 Apr 2021 16:04:54 -0400 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id 13OK4LWC057924; Sat, 24 Apr 2021 13:04:23 -0700 Message-ID: <608479A6.2000701@HIDDEN> Date: Sat, 24 Apr 2021 13:03:50 -0700 From: L A Walsh <coreutils@HIDDEN> User-Agent: Thunderbird 188.8.131.52 (Windows/20100228) MIME-Version: 1.0 To: Paul Eggert <eggert@HIDDEN> Subject: Gnu design flaw fixes hindered by Gnu (sexism?) biases References: <0910fdcb-ec97-45e2-9128-4bbb369d74d9@HIDDEN> <31aa9fcc-4be5-7a13-4682-3c320b46091d@HIDDEN> In-Reply-To: <31aa9fcc-4be5-7a13-4682-3c320b46091d@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=184.108.40.206; envelope-from=coreutils@HIDDEN; helo=Ishtar.sc.tlinx.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Coreutils <bug-coreutils@HIDDEN>, Peter van Dijk <peter@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) On 2021/04/21 19:11, Paul Eggert wrote: > On 4/18/21 10:46 AM, Peter van Dijk wrote: >> While the manual (but not the manpage) mentions the data loss, I >> think it would be great if sort did not have this problem at all, and >> I think the OpenGroup text also says it should not have this problem. >> I looked around, and a lot of software does get this right (by opening a randomly-named temp file to write to, and only moving it into place when it is written successfuly) - GNU sed -i, OpenBSD sort, and surely there are more. As a bonus, doing this would also make the `-o someinputfile -m` case safe. >> > > I don't know of any 'sort' implementation that does not have the > problem at all. ... Nevertheless, it is the same problem as reported _1.5_months_ ago where no one had time to look at the same design flaw in gnu-coreutils implementation of 'cp' (bug#47059). That bug, still untriaged, had the same suggested solution: "When creating a link to a local file, I first create the link to a temporary name to ensure I have appropriate access (or that its not cross-linked in this case)." At that time the bug was only reported against 'cp', but it seems that not testing for final location writeability is a gnu-bug stemming from mono-culture development where outside ideas and bug reports tend to be ignored. The previous, similar bug in 'cp' I reported was ignored for 1.5-2 YEARS, before a large enough corporation lost enough data for GNU to pay attention. Though in this case, did the report against 'sort' get noticed because the reporter wasn't female? Perhaps others within GNU have inculcated the biases of RMS and my feelings of tolerance were naive (wouldn't be the first time). That bug was left untriaged that was left untriaged with bug#47059. And it is the same solution -- opening a randomly-named temp file to write to and only performing final actions when writeability of the destination is confirmed. > > Also, I don't see where the Open Group spec says what you're saying. > On the contrary, the spec merely says that '-o output' should cause > output to be sent to the output file. If there are multiple hard links > to the output file, this suggests 'sort' should update the output > file's contents without breaking any hard links. Admittedly the Open > Group spec is a bit vague in this area, but I certainly don't see > anything implying that GNU 'sort' does not conform to POSIX in this area. > > FreeBSD 'sort' has a problem, in that 'sort -o A B' preserves all hard > links to A's file, but 'sort -o A A' does not because it breaks the > link from A. That's confusing. > > Traditional Unix 'sort -o A' behaves the way GNU 'sort' does; it > preserves all hard links to A's file. So there is a compatibility > argument for doing things the way GNU 'sort' does them, even if that > might lead to more data loss in rare cases. > > >
L A Walsh <coreutils@HIDDEN>:
bug-coreutils@HIDDEN. Full text available.
coreutils. Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.