summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-archive.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-02-19 13:47:57 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-02-19 13:48:27 -0800
commit734eb7e457da8a9b2c91798d591c03285c6967ce (patch)
treec8d8dc92d4af164c895d73de29e3d548385cff3c /lisp/gnus/mm-archive.el
parent4b118bdca1d8aa130fb67eadb16e08e87e698aa4 (diff)
downloademacs-734eb7e457da8a9b2c91798d591c03285c6967ce.tar.gz
emacs-734eb7e457da8a9b2c91798d591c03285c6967ce.tar.bz2
emacs-734eb7e457da8a9b2c91798d591c03285c6967ce.zip
Fix some file-modes races
* lisp/gnus/gnus-start.el (gnus-save-newsrc-file) (gnus-slave-save-newsrc): * lisp/gnus/gnus-uu.el (gnus-uu-initialize): * lisp/gnus/mm-archive.el (mm-dissect-archive): * lisp/gnus/mm-decode.el (mm-temp-files-delete) (mm-display-external): * lisp/image-dired.el (image-dired-create-thumb-1): Use with-file-modes rather than setting the file modes later. This fixes some race conditions where the file temporarily has the wrong permissions.
Diffstat (limited to 'lisp/gnus/mm-archive.el')
-rw-r--r--lisp/gnus/mm-archive.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/gnus/mm-archive.el b/lisp/gnus/mm-archive.el
index 71676c12a46..56253afa193 100644
--- a/lisp/gnus/mm-archive.el
+++ b/lisp/gnus/mm-archive.el
@@ -42,8 +42,9 @@
dir)
(unless decoder
(error "No decoder found for %s" type))
- (setq dir (make-temp-file (expand-file-name "emm." mm-tmp-directory) 'dir))
- (set-file-modes dir #o700)
+ (with-file-modes #o700
+ (setq dir (make-temp-file (expand-file-name "emm." mm-tmp-directory)
+ 'dir)))
(unwind-protect
(progn
(mm-with-unibyte-buffer