From: Glenn Morris Date: Wed, 1 Oct 2014 23:39:50 +0000 (-0400) Subject: * package.el (package-import-keyring): Create gnupg directory private. X-Git-Tag: emacs-24.3.94~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c8ea4b9f3d6b636f171f43bee80e1ebe856cfe2d;p=emacs.git * package.el (package-import-keyring): Create gnupg directory private. See bug#17625#155. --- 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)