diff options
Diffstat (limited to 'emacs/23.4/18_all_browse-url-tmpfile.patch')
-rw-r--r-- | emacs/23.4/18_all_browse-url-tmpfile.patch | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/emacs/23.4/18_all_browse-url-tmpfile.patch b/emacs/23.4/18_all_browse-url-tmpfile.patch deleted file mode 100644 index ea62328..0000000 --- a/emacs/23.4/18_all_browse-url-tmpfile.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fix insecure use of temporary files. -Patch from upstream bzr, backported to Emacs 23.4. -https://bugs.gentoo.org/509830 -CVE-2014-3423 - -revno: 117087 -fixes bug: http://debbugs.gnu.org/17428 -committer: Glenn Morris <rgm@gnu.org> -branch nick: emacs-24 -timestamp: Thu 2014-05-08 14:10:36 -0400 -message: - * browse-url.el (browse-url-mosaic): Be careful when writing /tmp/Mosaic.PID. - ---- emacs-23.4-orig/lisp/net/browse-url.el -+++ emacs-23.4/lisp/net/browse-url.el -@@ -1234,28 +1234,26 @@ - (let ((pidfile (expand-file-name browse-url-mosaic-pidfile)) - pid) - (if (file-readable-p pidfile) -- (save-excursion -- (find-file pidfile) -- (goto-char (point-min)) -- (setq pid (read (current-buffer))) -- (kill-buffer nil))) -- (if (and pid (zerop (signal-process pid 0))) ; Mosaic running -- (save-excursion -- (find-file (format "/tmp/Mosaic.%d" pid)) -- (erase-buffer) -- (insert (if (browse-url-maybe-new-window new-window) -- "newwin\n" -- "goto\n") -- url "\n") -- (save-buffer) -- (kill-buffer nil) -+ (with-temp-buffer -+ (insert-file-contents pidfile) -+ (setq pid (read (current-buffer))))) -+ (if (and (integerp pid) (zerop (signal-process pid 0))) ; Mosaic running -+ (progn -+ (with-temp-buffer -+ (insert (if (browse-url-maybe-new-window new-window) -+ "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)) - ;; Send signal SIGUSR to Mosaic - (message "Signaling Mosaic...") - (signal-process pid 'SIGUSR1) - ;; Or you could try: - ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) -- (message "Signaling Mosaic...done") -- ) -+ (message "Signaling Mosaic...done")) - ;; Mosaic not running - start it - (message "Starting %s..." browse-url-mosaic-program) - (apply 'start-process "xmosaic" nil browse-url-mosaic-program |