GNU bug report logs - #11912
24.1; 'M' in Dired on a symlink does not refresh the display

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Wed, 11 Jul 2012 16:45:01 UTC

Severity: minor

Found in version 24.1

Full log


Message #19 received at 11912 <at> debbugs.gnu.org (full text, mbox):

From: "Michalis V." <mvar.40k <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: "Michalis V." <mvar.40k <at> gmail.com>, 11912 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>, Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#11912: 24.1; 'M' in Dired on a symlink does not refresh the
 display
Date: Wed, 25 Aug 2021 11:37:34 +0300
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> In Linux you can't change the permissions on a symlink (they're always
> 777):
>
>        chmod never changes the permissions of symbolic links; the chmod system
>        call cannot change their permissions.  This is not a problem since  the
>        permissions  of  symbolic links are never used. 
>
> So I'm surprised that the `M' command even tries to do the chmod on the
> symlink.  This was apparently done as part of a security audit:
>
> commit 9d626dffc6ba62c0d7a1a5c712f576ed8684fd66
> Author:     Paul Eggert <eggert <at> cs.ucla.edu>
> AuthorDate: Sun Feb 23 16:19:42 2020 -0800
>
>     Add 'nofollow' flag to set-file-modes etc.
>     
>     This avoids some race conditions (Bug#39683).  E.g., if some other
>     program changes a file to a symlink between the time Emacs creates
>     the file and the time it changes the file’s permissions, using the
>     new flag prevents Emacs from inadvertently changing the
>     permissions of a victim in some completely unrelated directory.
>
> Hm.  I'm not sure why this should affect the `M' command in dired, though...
>
> I've added Paul to the CCs; perhaps he has some comments.

that's true; but doing chmod on the symlink from bash will actually
have effect on the symlinked file itself, so from a user perspective
i'd expect dired to behave similarly (that is, M to resolve the symlink
and apply the chmod mask to the actual file). But i never thought of
race conditions and potential security problems so the current behavior
looks like the best one.

thanks,
Michalis




This bug report was last modified 3 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.