From c8ea4b9f3d6b636f171f43bee80e1ebe856cfe2d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 1 Oct 2014 19:39:50 -0400 Subject: [PATCH] * package.el (package-import-keyring): Create gnupg directory private. See bug#17625#155. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0a0fb21b1e5..db08b101dc5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-10-01 Glenn Morris + + * emacs-lisp/package.el (package-import-keyring): + Create gnupg directory private. (Bug#17625#155) + 2014-10-01 Stefan Monnier * progmodes/python.el (python-shell-completion-get-completions): diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 958e9d29ebd..823ba365e62 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1298,7 +1298,13 @@ similar to an entry in `package-alist'. Save the cached copy to (setq file (expand-file-name file)) (let ((context (epg-make-context 'OpenPGP)) (homedir (expand-file-name "gnupg" package-user-dir))) - (make-directory homedir t) + ;; FIXME Use `with-file-modes' when merged to trunk. + (let ((umask (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes 448) + (make-directory homedir t)) + (set-default-file-modes umask))) (epg-context-set-home-directory context homedir) (message "Importing %s..." (file-name-nondirectory file)) (epg-import-keys-from-file context file) -- 2.39.2