From 8c6699ab19d4fed0baa98988accbd8141ae81fe9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 10 May 2014 13:48:36 -0700 Subject: * browse-url.el (browse-url-mosaic): Create /tmp/Mosaic.PID as a private file. --- lisp/net/browse-url.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lisp/net/browse-url.el') diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 80dffb3fa4a..33f4eda9604 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1343,10 +1343,16 @@ used instead of `browse-url-new-window-flag'." "newwin\n" "goto\n") url "\n") - (if (file-exists-p (setq pidfile (format "/tmp/Mosaic.%d" pid))) - (delete-file pidfile)) - ;; http://debbugs.gnu.org/17428. Use O_EXCL. - (write-region nil nil pidfile nil 'silent nil 'excl)) + (let ((umask (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes ?\700) + (if (file-exists-p + (setq pidfile (format "/tmp/Mosaic.%d" pid))) + (delete-file pidfile)) + ;; http://debbugs.gnu.org/17428. Use O_EXCL. + (write-region nil nil pidfile nil 'silent nil 'excl)) + (set-default-file-modes umask)))) ;; Send signal SIGUSR to Mosaic (message "Signaling Mosaic...") (signal-process pid 'SIGUSR1) -- cgit v1.2.1