[Python-modules-commits] r10763 - in packages/python-docutils/trunk/debian (3 files)

jwilk-guest at users.alioth.debian.org jwilk-guest at users.alioth.debian.org
Sun Dec 13 17:26:23 UTC 2009


    Date: Sunday, December 13, 2009 @ 17:26:22
  Author: jwilk-guest
Revision: 10763

Fix insecure use of temporary files in the Emacs major mode for reStructuredText (closes: #560755).

Added:
  packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff
Modified:
  packages/python-docutils/trunk/debian/changelog
  packages/python-docutils/trunk/debian/patches/series

Modified: packages/python-docutils/trunk/debian/changelog
===================================================================
--- packages/python-docutils/trunk/debian/changelog	2009-12-13 15:40:19 UTC (rev 10762)
+++ packages/python-docutils/trunk/debian/changelog	2009-12-13 17:26:22 UTC (rev 10763)
@@ -5,6 +5,8 @@
   * Demote dependency on an ElementTree implementation to recommendation, as it
     is only used by /usr/bin/rst2odt; remove python-lxml from alternatives, as
     it is never used by the script (closes: #560328).
+  * Fix insecure use of temporary files in the Emacs major mode for
+    reStructuredText (closes: #560755).
 
  -- Jakub Wilk <ubanus at users.sf.net>  Sat, 12 Dec 2009 00:09:38 +0100
 

Added: packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff
===================================================================
--- packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff	                        (rev 0)
+++ packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff	2009-12-13 17:26:22 UTC (rev 10763)
@@ -0,0 +1,53 @@
+Description: Fix insecure use of temporary files
+ in the Emacs major mode for reStructuredText (rst.el).
+Author: Jakub Wilk <ubanus at users.sf.net>
+Bug-Debian: http://bugs.debian.org/560755
+Last-Update: 2009-12-13
+
+Index: python-docutils-0.6/tools/editors/emacs/rst.el
+===================================================================
+--- python-docutils-0.6.orig/tools/editors/emacs/rst.el	2009-05-21 11:02:22.000000000 +0200
++++ python-docutils-0.6/tools/editors/emacs/rst.el	2009-12-13 18:22:16.000000000 +0100
+@@ -3301,13 +3301,32 @@
+      (cadr (assq 'pseudoxml rst-compile-toolsets))
+      standard-output)))
+ 
++(defvar rst-temp-dir nil)
++(make-variable-buffer-local 'rst-temp-dir)
++
++(defun rst-get-temp-dir ()
++  (or rst-temp-dir
++    (setq rst-temp-dir 
++      (file-name-as-directory (make-temp-file "rst-" t))
++    )
++  )
++)
++
++(defun rst-remove-temp-dir ()
++  (require 'dired)
++  (if rst-temp-dir (dired-delete-file rst-temp-dir 'always))
++)
++
++(add-hook 'kill-buffer-hook 'rst-remove-temp-dir)
++(add-hook 'kill-emacs-hook 'rst-remove-temp-dir)
++
+ (defvar rst-pdf-program "xpdf"
+   "Program used to preview PDF files.")
+ 
+ (defun rst-compile-pdf-preview ()
+   "Convert the document to a PDF file and launch a preview program."
+   (interactive)
+-  (let* ((tmp-filename "/tmp/out.pdf")
++  (let* ((tmp-filename (concat (rst-get-temp-dir) "out.pdf"))
+ 	 (command (format "%s %s %s && %s %s"
+ 			  (cadr (assq 'pdf rst-compile-toolsets))
+ 			  buffer-file-name tmp-filename
+@@ -3323,7 +3342,7 @@
+ (defun rst-compile-slides-preview ()
+   "Convert the document to an S5 slide presentation and launch a preview program."
+   (interactive)
+-  (let* ((tmp-filename "/tmp/slides.html")
++  (let* ((tmp-filename (concat (rst-get-temp-dir) "slides.html"))
+ 	 (command (format "%s %s %s && %s %s"
+ 			  (cadr (assq 's5 rst-compile-toolsets))
+ 			  buffer-file-name tmp-filename

Modified: packages/python-docutils/trunk/debian/patches/series
===================================================================
--- packages/python-docutils/trunk/debian/patches/series	2009-12-13 15:40:19 UTC (rev 10762)
+++ packages/python-docutils/trunk/debian/patches/series	2009-12-13 17:26:22 UTC (rev 10763)
@@ -2,6 +2,7 @@
 12_more_usrbinenv.diff
 13_install_roman.diff
 14_use_setuptools.diff
+emacs-temporary-files.diff
 15_emacs_debian_paths.diff
 16_disable_picins.diff
 17_revert_buildhtml.diff




More information about the Python-modules-commits mailing list