From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#58919: 28.2; dired-copy-file-recursive fails to overwrite directory Date: Tue, 1 Nov 2022 11:04:22 -0700 Organization: UCLA Computer Science Department Message-ID: <31dc6bb7-ada3-aeac-c65b-d7de4a326026@cs.ucla.edu> References: <87y1sws6eq.fsf@posteo.net> <83wn8gdu4k.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="773"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Cc: 58919@debbugs.gnu.org To: Eli Zaretskii , Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 01 19:05:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opvdf-000AVv-CJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Nov 2022 19:05:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opvdT-0003QB-OJ; Tue, 01 Nov 2022 14:05:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opvdH-0003Ki-Tn for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 14:05:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opvdG-0004RV-J4 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 14:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opvdG-0005Tc-9c for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2022 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58919 X-GNU-PR-Package: emacs Original-Received: via spool by 58919-submit@debbugs.gnu.org id=B58919.166732587021009 (code B ref 58919); Tue, 01 Nov 2022 18:05:02 +0000 Original-Received: (at 58919) by debbugs.gnu.org; 1 Nov 2022 18:04:30 +0000 Original-Received: from localhost ([127.0.0.1]:44223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opvck-0005Sm-8l for submit@debbugs.gnu.org; Tue, 01 Nov 2022 14:04:30 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opvci-0005SZ-V9 for 58919@debbugs.gnu.org; Tue, 01 Nov 2022 14:04:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 88412160085; Tue, 1 Nov 2022 11:04:23 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 2vhWO7illU2l; Tue, 1 Nov 2022 11:04:22 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B0A00160090; Tue, 1 Nov 2022 11:04:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu B0A00160090 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1667325862; bh=W00eDu82b4DEWOkQReYWKi364rRgDm0ganyIj64Xbwk=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type: Content-Transfer-Encoding; b=c2MDFxcJwJC31LS6E/AUAhenXOWYdIGF6t5m/mnPIoUUYVxm9lKsdwjXaBKJf0Q+f Ls+o8F3f09Nb/7XsL74J+dline9xUx/AI8JmH0oDuU+MDmnqhpjAXT81kQxDnkjEUn NWVBIKdLDkozw43ie1ZlFac5xqa5MzsWnUiMngs4= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0xlq_LEhOMZM; Tue, 1 Nov 2022 11:04:22 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 89758160085; Tue, 1 Nov 2022 11:04:22 -0700 (PDT) Content-Language: en-US In-Reply-To: <83wn8gdu4k.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246800 Archived-At: On 2022-10-31 06:01, Eli Zaretskii wrote: > Paul, could you please look into this? I am taking a look. Sigh, what a mess this code is; even the proposed fix has a TOCTOU bug. The simplest fix I can see is to enhance make-directory so that it returns t if the directory already existed and PARENTS was given, nil on any other successful return. This would require changes to Tramp to avoid races there. I plan to post a proposed patch for comment.