Fix some file-mode races
* lisp/emacs-lisp/autoload.el (autoload-ensure-file-writeable): * lisp/files.el (after-find-file): * lisp/gnus/gnus-start.el (gnus-dribble-read-file): * lisp/htmlfontify.el (hfy-copy-and-fontify-file): * lisp/server.el (server-ensure-safe-dir): Avoid a race when getting file permissions.
This commit is contained in:
parent
b124cb8f30
commit
bc1c2cf009
5 changed files with 14 additions and 16 deletions
|
@ -398,9 +398,8 @@ FILE's name."
|
|||
;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile,
|
||||
;; which was designed to handle CVSREAD=1 and equivalent.
|
||||
(and autoload-ensure-writable
|
||||
(file-exists-p file)
|
||||
(let ((modes (file-modes file)))
|
||||
(if (zerop (logand modes #o0200))
|
||||
(if (and modes (zerop (logand modes #o0200)))
|
||||
;; Ignore any errors here, and let subsequent attempts
|
||||
;; to write the file raise any real error.
|
||||
(ignore-errors (set-file-modes file (logior modes #o0200))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue