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#11912: 24.1; 'M' in Dired on a symlink does not refresh the display Date: Tue, 24 Aug 2021 10:32:01 -0700 Organization: UCLA Computer Science Department Message-ID: <8678ec5a-a5f2-8ae4-6212-c377c3abe9e8@cs.ucla.edu> References: <83txxeb6q8.fsf@gnu.org> <87tujf9m52.fsf@cnu407c2zx.nsn-intra.net> <87fsuyonpv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F3C287D3069EA0FF0DEE778D" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32978"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: "Michalis V." , 11912@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 24 19:33:12 2021 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 1mIaIR-0008GP-8X for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 19:33:11 +0200 Original-Received: from localhost ([::1]:43896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIaIP-00053S-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Aug 2021 13:33:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIaII-000524-GI for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIaII-0007rw-89 for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIaIH-0003dn-Sz for bug-gnu-emacs@gnu.org; Tue, 24 Aug 2021 13:33:01 -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, 24 Aug 2021 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11912 X-GNU-PR-Package: emacs Original-Received: via spool by 11912-submit@debbugs.gnu.org id=B11912.162982633413931 (code B ref 11912); Tue, 24 Aug 2021 17:33:01 +0000 Original-Received: (at 11912) by debbugs.gnu.org; 24 Aug 2021 17:32:14 +0000 Original-Received: from localhost ([127.0.0.1]:45113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIaHW-0003cc-Ij for submit@debbugs.gnu.org; Tue, 24 Aug 2021 13:32:14 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIaHV-0003cP-3x for 11912@debbugs.gnu.org; Tue, 24 Aug 2021 13:32:14 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A39711600BC; Tue, 24 Aug 2021 10:32:07 -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 OxTlY-GtxVzn; Tue, 24 Aug 2021 10:32:02 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E31471600BE; Tue, 24 Aug 2021 10:32:02 -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 Xbw3E-A8IAPx; Tue, 24 Aug 2021 10:32:02 -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 420451600BC; Tue, 24 Aug 2021 10:32:02 -0700 (PDT) In-Reply-To: <87fsuyonpv.fsf@gnus.org> Content-Language: en-US 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: , 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:212559 Archived-At: This is a multi-part message in MIME format. --------------F3C287D3069EA0FF0DEE778D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/24/21 8:40 AM, Lars Ingebrigtsen wrote: > I'm surprised that the `M' command even tries to do the chmod on the > symlink. Unfortunately the M command doesn't know in advance whether chmod will=20 work on the symlink, as that is platform and filesystem dependent (this=20 is in addition to the usual race-condition problem). So as a practical=20 matter the M command must try the chmod and report the failure somehow.=20 (Perhaps the reporting could be improved; I expect that's low priority.) A few things: * I neglected to document this behavior change, so I just now installed=20 the attached to fix that oversight. * Because of this behavior change, the example Eli gives at the start of=20 Bug#11912 is now obsolete, as the bug has been fixed in a different way.=20 However, as Eli mentioned, there are other commands (like 'O') where the=20 bug is still present. * And this suggests that some longstanding security and other bugs=20 remain in this area. I plan to file more bug reports that will cite=20 Bug#11912. If the other bugs are fixed, then Bug#11912 should be=20 completely obsolete and can be closed. --------------F3C287D3069EA0FF0DEE778D Content-Type: text/x-patch; charset=UTF-8; name="0001-Doc-that-dired-do-chmod-no-longer-follows-symlinks.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Doc-that-dired-do-chmod-no-longer-follows-symlinks.patc"; filename*1="h" =46rom 2c8657f4f63e6d2b6e1d0866dd597bc85b422430 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 24 Aug 2021 10:15:43 -0700 Subject: [PATCH] Doc that dired-do-chmod no longer follows symlinks * doc/emacs/dired.texi (Operating on Files): * etc/NEWS: Document this security precaution. --- doc/emacs/dired.texi | 4 +++- etc/NEWS | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 680b20c593..e84ed0f7b6 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -823,7 +823,9 @@ Operating on Files Change the mode (also called @dfn{permission bits}) of the specified files (@code{dired-do-chmod}). @var{modespec} can be in octal or symbolic notation, like arguments handled by the @command{chmod} -program. +program. This command does not follow symbolic links, so it reports +an error if you try to change the mode of a symbolic link on a +platform where such modes are immutable. =20 @findex dired-do-chgrp @kindex G @r{(Dired)} diff --git a/etc/NEWS b/etc/NEWS index 588290f433..07a78216b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -909,6 +909,12 @@ time zones will use a form like "+0100" instead of "= CET". If non-nil, Dired will kill the current buffer when selecting a new directory to display. =20 ++++ +*** Behavior change on 'dired-do-chmod'. +As a security precaution, Dired's M command no longer follows symbolic +links. Instead, it changes the symbolic link's own mode; this always +fails on platforms where such modes are immutable. + --- *** Behavior change on 'dired-clean-confirm-killing-deleted-buffers'. Previously, if 'dired-clean-up-buffers-too' was non-nil, and --=20 2.30.2 --------------F3C287D3069EA0FF0DEE778D--