From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#39793: 28.0.50; set-file-modes nofollow does not work on mounted directories Date: Wed, 26 Feb 2020 17:13:45 -0800 Organization: UCLA Computer Science Department Message-ID: References: <87sgiygyd1.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------05203161D66BED78A101647B" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="11802"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Cc: 39793@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 27 02:14:13 2020 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 1j77kj-0002z8-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Feb 2020 02:14:13 +0100 Original-Received: from localhost ([::1]:52372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j77ki-00029K-0z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Feb 2020 20:14:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48361) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j77kZ-000293-On for bug-gnu-emacs@gnu.org; Wed, 26 Feb 2020 20:14:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j77kY-0005EC-4g for bug-gnu-emacs@gnu.org; Wed, 26 Feb 2020 20:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j77kX-0005Do-Vh for bug-gnu-emacs@gnu.org; Wed, 26 Feb 2020 20:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j77kX-0006vD-PJ for bug-gnu-emacs@gnu.org; Wed, 26 Feb 2020 20:14:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87sgiygyd1.fsf@gmx.de> Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Feb 2020 01:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39793 X-GNU-PR-Package: emacs Original-Received: via spool by 39793-submit@debbugs.gnu.org id=B39793.158276603726588 (code B ref 39793); Thu, 27 Feb 2020 01:14:01 +0000 Original-Received: (at 39793) by debbugs.gnu.org; 27 Feb 2020 01:13:57 +0000 Original-Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j77kT-0006um-4r for submit@debbugs.gnu.org; Wed, 26 Feb 2020 20:13:57 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j77kP-0006uP-9S for 39793@debbugs.gnu.org; Wed, 26 Feb 2020 20:13:54 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AA49E16009E; Wed, 26 Feb 2020 17:13:46 -0800 (PST) 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 Skxu9tvVRQEo; Wed, 26 Feb 2020 17:13:45 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A90521600A0; Wed, 26 Feb 2020 17:13:45 -0800 (PST) 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 1NEQHrao5Nzy; Wed, 26 Feb 2020 17:13:45 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8F8EB16009E; Wed, 26 Feb 2020 17:13:45 -0800 (PST) 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: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176522 Archived-At: This is a multi-part message in MIME format. --------------05203161D66BED78A101647B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for reporting that. I installed the attached patch into master; please give it a try. --------------05203161D66BED78A101647B Content-Type: text/x-patch; charset=UTF-8; name="0001-nnmail-cache-close-should-not-use-nofollow.patch" Content-Disposition: attachment; filename="0001-nnmail-cache-close-should-not-use-nofollow.patch" Content-Transfer-Encoding: quoted-printable >From 07da629926daf849aab248175c88cf53a5e21558 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 26 Feb 2020 17:10:21 -0800 Subject: [PATCH] nnmail-cache-close should not use nofollow MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit nnmail-cache-close did not work when ~/.nnmail-cache was a symlink to some other directory. Reported by Michael Albinus (Bug#39793). * lisp/gnus/nnbabyl.el (nnbabyl-create-mbox): * lisp/gnus/nndiary.el (nndiary-generate-nov-file): * lisp/gnus/nnfolder.el (nnfolder-possibly-change-group): * lisp/gnus/nnmbox.el (nnmbox-create-mbox): * lisp/gnus/nnml.el (nnml-generate-nov-file): Pass =E2=80=98excl=E2=80=99 to nnmail-write-region when creating a file, = for safety. * lisp/gnus/nnmail.el (nnmail-write-region): Add optional MUSTBENEW arg, to stay consistent with write-region. Past =E2=80=98nofollow=E2=80=99 to set-file-modes only when MUSTBENEW is = =E2=80=98excl=E2=80=99. --- lisp/gnus/nnbabyl.el | 2 +- lisp/gnus/nndiary.el | 2 +- lisp/gnus/nnfolder.el | 2 +- lisp/gnus/nnmail.el | 8 +++++--- lisp/gnus/nnmbox.el | 2 +- lisp/gnus/nnml.el | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index cb22933b52..480d794b9a 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el @@ -544,7 +544,7 @@ nnbabyl-create-mbox (setq buffer-file-name nnbabyl-mbox-file) (insert "BABYL OPTIONS:\n\n\^_") (nnmail-write-region - (point-min) (point-max) nnbabyl-mbox-file t 'nomesg)))) + (point-min) (point-max) nnbabyl-mbox-file t 'nomesg nil 'excl)))) =20 (defun nnbabyl-read-mbox () (nnmail-activate 'nnbabyl) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index ac394ae53d..945ef0351e 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -1115,7 +1115,7 @@ nndiary-generate-nov-file (widen)) (setq files (cdr files))) (with-current-buffer nov-buffer - (nnmail-write-region 1 (point-max) nov nil 'nomesg) + (nnmail-write-region 1 (point-max) nov nil 'nomesg nil 'excl) (kill-buffer (current-buffer)))))) =20 (defun nndiary-nov-delete-article (group article) diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index d1eeb04697..c27af1742d 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -735,7 +735,7 @@ nnfolder-possibly-change-group (or nnfolder-file-coding-system-for-write nnfolder-file-coding-system-for-write))) (nnmail-write-region (point-min) (point-min) - file t 'nomesg))) + file t 'nomesg nil 'excl))) (when (setq nnfolder-current-buffer (nnfolder-read-folder group)) (set-buffer nnfolder-current-buffer) (push (list group nnfolder-current-buffer) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 93e4b0e7a8..3be843c91f 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1953,12 +1953,14 @@ nnmail-check-syntax (unless (re-search-forward "^Message-ID[ \t]*:" nil t) (insert "Message-ID: " (nnmail-message-id) "\n"))))) =20 -(defun nnmail-write-region (start end filename &optional append visit lo= ckname) +(defun nnmail-write-region (start end filename + &optional append visit lockname mustbenew) "Do a `write-region', and then set the file modes." (let ((coding-system-for-write nnmail-file-coding-system) (file-name-coding-system nnmail-pathname-coding-system)) - (write-region start end filename append visit lockname) - (set-file-modes filename nnmail-default-file-modes 'nofollow))) + (write-region start end filename append visit lockname mustbenew) + (set-file-modes filename nnmail-default-file-modes + (when (eq mustbenew 'excl) 'nofollow)))) =20 ;;; ;;; Status functions diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el index a191f887c7..8b3d80266e 100644 --- a/lisp/gnus/nnmbox.el +++ b/lisp/gnus/nnmbox.el @@ -613,7 +613,7 @@ nnmbox-create-mbox (dir (file-name-directory nnmbox-mbox-file))) (and dir (gnus-make-directory dir)) (nnmail-write-region (point-min) (point-min) - nnmbox-mbox-file t 'nomesg)))) + nnmbox-mbox-file t 'nomesg nil 'excl)))) =20 (defun nnmbox-read-mbox () (nnmail-activate 'nnmbox) diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 2c39ab8e36..baf5d54b74 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -901,7 +901,7 @@ nnml-generate-nov-file (nnheader-insert-nov headers))) (widen)))) (with-current-buffer nov-buffer - (nnmail-write-region (point-min) (point-max) nov nil 'nomesg) + (nnmail-write-region (point-min) (point-max) nov nil 'nomesg nil 'excl) (kill-buffer (current-buffer)))))) =20 (defun nnml-nov-delete-article (group article) --=20 2.24.1 --------------05203161D66BED78A101647B--