From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#28023: fix make-temp-file race on local host Date: Sun, 13 Aug 2017 00:21:03 -0700 Organization: UCLA Computer Science Department Message-ID: <2ad20ed4-97aa-0823-81af-5757bf0f3033@cs.ucla.edu> References: <8c2c16ff-94ec-a691-57b1-bab8f5b39dfb@cs.ucla.edu> <87shh18c9e.fsf@detlef> <87k22d7zrb.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1502608937 19808 195.159.176.226 (13 Aug 2017 07:22:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 13 Aug 2017 07:22:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: 28023-done@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 13 09:22:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgnDt-0004bK-Bb for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Aug 2017 09:22:09 +0200 Original-Received: from localhost ([::1]:44482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgnDx-0001jz-Rz for geb-bug-gnu-emacs@m.gmane.org; Sun, 13 Aug 2017 03:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgnDq-0001jD-MN for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 03:22:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgnDm-0007X7-KL for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 03:22:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgnDm-0007Wu-H0 for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 03:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dgnDm-0005LV-4p for bug-gnu-emacs@gnu.org; Sun, 13 Aug 2017 03:22:02 -0400 Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Aug 2017 07:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 28023 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 28023@debbugs.gnu.org, eggert@cs.ucla.edu, eggert@cs.ucla.edu Original-Received: via spool by 28023-done@debbugs.gnu.org id=D28023.150260887220535 (code D ref 28023); Sun, 13 Aug 2017 07:22:01 +0000 Original-Received: (at 28023-done) by debbugs.gnu.org; 13 Aug 2017 07:21:12 +0000 Original-Received: from localhost ([127.0.0.1]:59120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgnCx-0005L9-MA for submit@debbugs.gnu.org; Sun, 13 Aug 2017 03:21:11 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgnCw-0005L3-5m for 28023-done@debbugs.gnu.org; Sun, 13 Aug 2017 03:21:10 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3CDAD160759; Sun, 13 Aug 2017 00:21:04 -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 wifVLBJk16N8; Sun, 13 Aug 2017 00:21:03 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 679D8160861; Sun, 13 Aug 2017 00:21:03 -0700 (PDT) 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 4-t6FI65Ftja; Sun, 13 Aug 2017 00:21:03 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 39551160759; Sun, 13 Aug 2017 00:21:03 -0700 (PDT) In-Reply-To: <87k22d7zrb.fsf@detlef> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135712 Archived-At: Michael Albinus wrote: > Paul Eggert writes: >=20 >> Tramp needs to support a new method make-temp-file that creates a file >> (or directory) atomically, as make-temp-file does locally now. > That means, make-temp-file shall be converted into a magic file name > operation. I'll do my best, but I don't know whether we could get an > implementation for all Tramp methods w/o a race condition. >=20 >> Tramp also needs to support the excl flag of write-region (currently >> it ignores that flag). > This sounds trivial. And yes, it will help. Thanks for doing that. Because of that, I'm no longer seeing a race in=20 make-temp-file, even for Tramp files. That is, although my proposed patch= is=20 still a performance win on local files, I don't see how it is a correctne= ss win=20 any more. It's still worth installing for the performance reasons, though= , so I=20 did that and I am marking this bug as done. >> I was planning to write this up as a bug report after the patch goes >> in. > Pls do. To some extent this is moot now, if I understand things correctly. That i= s, the=20 only reason to write this up now would be for performance reasons, not a = race=20 condition. There is still a race involving destination directories, for both Tramp a= nd=20 non-Tramp versions. I plan to take a look at that next.