]> code.delx.au - gnu-emacs/commitdiff
* browse-url.el (browse-url-mosaic): Create /tmp/Mosaic.PID as a private file.
authorGlenn Morris <rgm@gnu.org>
Sat, 10 May 2014 20:48:36 +0000 (13:48 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 10 May 2014 20:48:36 +0000 (13:48 -0700)
lisp/ChangeLog
lisp/net/browse-url.el

index 0fa0c93915a7bd996dd6647c8d54b09b95bda0c3..22e45c46940c5511412e71fc656e41e0e243c703 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-10  Glenn Morris  <rgm@gnu.org>
+
+       * net/browse-url.el (browse-url-mosaic):
+       Create /tmp/Mosaic.PID as a private file.
+
 2014-05-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/nadvice.el: Support adding a given function multiple times.
index 80dffb3fa4a8123017fb9fc9d7b9bd00460c1fb2..33f4eda9604815f8744f73f19b932643869765f6 100644 (file)
@@ -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)