unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add NOFOLLOW flag to set-file-modes etc.
@ 2020-02-20  0:51 Paul Eggert
  0 siblings, 0 replies; only message in thread
From: Paul Eggert @ 2020-02-20  0:51 UTC (permalink / raw)
  To: Emacs development discussions

Bug#39683 proposes a patch to add an optional nofollow argument to 
set-file-modes and related functions; if this flag is t, the functions 
do not follow symbolic links. This should help Emacs avoid race 
conditions where it mistakenly changes the permissions of an arbitrary 
victim file that happens to be the target of a recently-created symlink.

Since the implementation of this new argument uses the POSIX fchmodat 
function with the AT_SYMLINK_NOFOLLOW flag, some work may be needed in 
the Microsoft porting code to emulate fchmodat.

Also, packages like Tramp that have a file-modes or set-file-modes 
wrapper should be updated if possible to support the new optional flag 
if it is given. For now, the patch leaves these as FIXME comments.

This is designed to be an upward-compatible change, even though the 
default, traditional behavior of following the symbolic link is 
typically more dangerous than the new option of not following the link.

Comments welcome.

https://debbugs.gnu.org/39683



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-20  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  0:51 Add NOFOLLOW flag to set-file-modes etc Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).