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: Sat, 12 Aug 2017 08:55:31 -0700 Organization: UCLA Computer Science Department Message-ID: References: <8c2c16ff-94ec-a691-57b1-bab8f5b39dfb@cs.ucla.edu> <87shh18c9e.fsf@detlef> <877ey9dqfl.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------92ADF72C7F2DDD70D62B4805" X-Trace: blaine.gmane.org 1502553374 17283 195.159.176.226 (12 Aug 2017 15:56:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Aug 2017 15:56:14 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: 28023@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 12 17:56:07 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 1dgYli-00046R-KS for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Aug 2017 17:56:06 +0200 Original-Received: from localhost ([::1]:35780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgYlp-0007Ww-5b for geb-bug-gnu-emacs@m.gmane.org; Sat, 12 Aug 2017 11:56:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgYlj-0007Wd-Dv for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2017 11:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgYle-0001VD-Ir for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2017 11:56:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgYle-0001Ur-EN for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2017 11:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dgYle-0002vi-7F for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2017 11:56: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: Sat, 12 Aug 2017 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28023 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28023-submit@debbugs.gnu.org id=B28023.150255334111255 (code B ref 28023); Sat, 12 Aug 2017 15:56:02 +0000 Original-Received: (at 28023) by debbugs.gnu.org; 12 Aug 2017 15:55:41 +0000 Original-Received: from localhost ([127.0.0.1]:56906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgYlJ-0002vT-5X for submit@debbugs.gnu.org; Sat, 12 Aug 2017 11:55:41 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:51622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dgYlG-0002vI-PO for 28023@debbugs.gnu.org; Sat, 12 Aug 2017 11:55:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9901B16084A; Sat, 12 Aug 2017 08:55:32 -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 rT3dGQm28E45; Sat, 12 Aug 2017 08:55:31 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C234E16084C; Sat, 12 Aug 2017 08:55:31 -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 E59mEt9DpFlI; Sat, 12 Aug 2017 08:55:31 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8A9CB16080C; Sat, 12 Aug 2017 08:55:31 -0700 (PDT) In-Reply-To: <877ey9dqfl.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:135685 Archived-At: This is a multi-part message in MIME format. --------------92ADF72C7F2DDD70D62B4805 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Michael Albinus wrote: > I've implemented this, commit ec5cfaa456. Thanks. Unfortunately this caused "make check" to fail on Fedora 26. I in= stalled=20 the attached patch, which causes the test to pass. Can you please look ov= er it=20 to see whether it makes sense, and look for similar problems elsewhere? (= I'm not=20 that familiar with Tramp.) Thanks. --------------92ADF72C7F2DDD70D62B4805 Content-Type: text/x-patch; name="0001-Adjust-jka-compr-to-recent-Tramp-changes.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Adjust-jka-compr-to-recent-Tramp-changes.patch" =46rom bbf52c142afbb9e10bf2ae20b3c77993fda26b43 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 12 Aug 2017 08:52:25 -0700 Subject: [PATCH] Adjust jka-compr to recent Tramp changes. * lisp/jka-compr.el (jka-compr-write-region): Two new args LOCKNAME and MUSTBENEW. --- lisp/jka-compr.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 26a7cf5..9e780f8 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -252,7 +252,8 @@ jka-compr-make-temp-name "This routine will return the name of a new file." (make-temp-file jka-compr-temp-name-template)) =20 -(defun jka-compr-write-region (start end file &optional append visit) +(defun jka-compr-write-region (start end file &optional + append visit lockname mustbenew) (let* ((filename (expand-file-name file)) (visit-file (if (stringp visit) (expand-file-name visit) filename)) (info (jka-compr-get-compression-info visit-file)) @@ -334,7 +335,8 @@ jka-compr-write-region (jka-compr-run-real-handler 'write-region (list (point-min) (point-max) filename - (and append can-append) 'dont)) + (and append can-append) 'dont + lockname mustbenew)) (erase-buffer)) ) =20 (delete-file temp-file) @@ -365,7 +367,8 @@ jka-compr-write-region nil) =20 (jka-compr-run-real-handler 'write-region - (list start end filename append visit))))) + (list start end filename append visit + lockname mustbenew))))) =20 =20 (defun jka-compr-insert-file-contents (file &optional visit beg end repl= ace) --=20 2.7.4 --------------92ADF72C7F2DDD70D62B4805--