diff --git a/emacs-23.1-bnc628268.patch b/emacs-23.1-bnc628268.patch new file mode 100644 index 0000000..a383e83 --- /dev/null +++ b/emacs-23.1-bnc628268.patch @@ -0,0 +1,58 @@ +--- lisp/loaddefs.el ++++ lisp/loaddefs.el 2010-08-12 15:38:16.235126810 +0000 +@@ -25974,7 +25974,7 @@ as its \"correct\" spelling; then the qu + + \(fn)" t nil) + +-(make-obsolete 'spell-buffer 'ispell-buffer "23.1") ++(define-obsolete-function-alias 'spell-buffer 'ispell-buffer "23.1") + + (autoload 'spell-word "spell" "\ + Check spelling of word at or before point. +@@ -25983,7 +25983,7 @@ and `query-replace' the entire buffer to + + \(fn)" t nil) + +-(make-obsolete 'spell-word 'ispell-word "23.1") ++(define-obsolete-function-alias 'spell-word 'ispell-word "23.1") + + (autoload 'spell-region "spell" "\ + Like `spell-buffer' but applies only to region. +@@ -25993,7 +25993,7 @@ for example, \"word\". + + \(fn START END &optional DESCRIPTION)" t nil) + +-(make-obsolete 'spell-region 'ispell-region "23.1") ++(define-obsolete-function-alias 'spell-region 'ispell-region "23.1") + + (autoload 'spell-string "spell" "\ + Check spelling of string supplied as argument. +--- lisp/textmodes/spell.el ++++ lisp/textmodes/spell.el 2010-08-12 15:36:22.119126692 +0000 +@@ -63,7 +63,7 @@ as its \"correct\" spelling; then the qu + (with-no-warnings + (spell-region (point-min) (point-max) "buffer"))) + ;;;###autoload +-(make-obsolete 'spell-buffer 'ispell-buffer "23.1") ++(define-obsolete-function-alias 'spell-buffer 'ispell-buffer "23.1") + + ;;;###autoload + (defun spell-word () +@@ -82,7 +82,7 @@ and `query-replace' the entire buffer to + (with-no-warnings + (spell-region beg end (buffer-substring beg end))))) + ;;;###autoload +-(make-obsolete 'spell-word 'ispell-word "23.1") ++(define-obsolete-function-alias 'spell-word 'ispell-word "23.1") + + ;;;###autoload + (defun spell-region (start end &optional description) +@@ -145,7 +145,7 @@ for example, \"word\"." + (query-replace-regexp (concat "\\b" (regexp-quote word) "\\b") + newword))))))) + ;;;###autoload +-(make-obsolete 'spell-region 'ispell-region "23.1") ++(define-obsolete-function-alias 'spell-region 'ispell-region "23.1") + + ;;;###autoload + (defun spell-string (string) diff --git a/emacs-23.1-rst.patch b/emacs-23.1-rst.patch new file mode 100644 index 0000000..6e1b921 --- /dev/null +++ b/emacs-23.1-rst.patch @@ -0,0 +1,90 @@ +Description: Patch to fix temporary file vulnerability + My approach is based on the premise that the make-temp-file function + provided from Emacs 22 onwards is safe. So, I backport the method to + the rst.el file, and bind it to the symbol rst--make-temp-file as + follows: + + - If the Emacs version is less than 22, use this custom version. This + works on Emacs 21, I tested it. + - If the Emacs version is 22 or more, bind rst--make-temp-file to the + make-temp-fil provided in the Emacs Lisp libraries. + + I don't see a solution for removing the temporary files, though. + + I am no expert on security or Emacs Lisp, but I hope this patch + provides a start. + +Author: Kumar Appaiah +Addopted due bug bnc#642787 for emacs 23.1 by Werner Fink +--- + + rst.el | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 46 insertions(+), 2 deletions(-) + +--- lisp/textmodes/rst.el ++++ lisp/textmodes/rst.el 2010-10-06 09:50:28.779926181 +0000 +@@ -3297,10 +3297,54 @@ or of the entire buffer, if the region i + (defvar rst-pdf-program "xpdf" + "Program used to preview PDF files.") + ++(if (> emacs-major-version 22) ++ (defalias 'rst--make-temp-file 'make-temp-file) ++ (defvar temporary-file-directory) ++ (defun rst--make-temp-file (prefix &optional dir-flag suffix) ++ "Create a temporary file. ++The returned file name (created by appending some random characters at the end ++of PREFIX, and expanding against `temporary-file-directory' if necessary), ++is guaranteed to point to a newly created empty file. ++You can then use `write-region' to write new data into the file. ++ ++If DIR-FLAG is non-nil, create a new empty directory instead of a file. ++ ++If SUFFIX is non-nil, add that at the end of the file name." ++ (let ((umask (default-file-modes)) ++ file) ++ (unwind-protect ++ (progn ++ ;; Create temp files with strict access rights. It's easy to ++ ;; loosen them later, whereas it's impossible to close the ++ ;; time-window of loose permissions otherwise. ++ (set-default-file-modes ?\700) ++ (while (condition-case () ++ (progn ++ (setq file ++ (make-temp-name ++ (if (zerop (length prefix)) ++ (file-name-as-directory ++ temporary-file-directory) ++ (expand-file-name prefix ++ temporary-file-directory)))) ++ (if suffix ++ (setq file (concat file suffix))) ++ (if dir-flag ++ (make-directory file) ++ (write-region "" nil file nil 'silent nil 'excl)) ++ nil) ++ (file-already-exists t)) ++ ;; the file was somehow created by someone else between ++ ;; `make-temp-name' and `write-region', let's try again. ++ nil) ++ file) ++ ;; Reset the umask. ++ (set-default-file-modes umask))))) ++ + (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 (rst--make-temp-file "rst" nil ".pdf")) + (command (format "rst2pdf.py %s %s && %s %s" + buffer-file-name tmp-filename + rst-pdf-program tmp-filename))) +@@ -3315,7 +3359,7 @@ or of the entire buffer, if the region i + (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 (rst--make-temp-file "rst" nil ".html")) + (command (format "rst2s5.py %s %s && %s %s" + buffer-file-name tmp-filename + rst-slides-program tmp-filename))) diff --git a/emacs.changes b/emacs.changes index 1574638..d973292 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,8 +1,18 @@ +------------------------------------------------------------------- +Wed Oct 6 11:59:06 CEST 2010 - werner@suse.de + +- Fix reStructuredText tmp file problem (bnc#642787) + ------------------------------------------------------------------- Tue Sep 7 12:54:28 UTC 2010 - aj@suse.de - BuildRequire gpm-devel +------------------------------------------------------------------- +Thu Aug 12 17:40:53 CEST 2010 - werner@suse.de + +- Avoid trouble with spell see bug bnc#628268 + ------------------------------------------------------------------- Thu May 20 12:44:38 CEST 2010 - werner@suse.de diff --git a/emacs.spec b/emacs.spec index 02754aa..3c1adce 100644 --- a/emacs.spec +++ b/emacs.spec @@ -30,7 +30,7 @@ Url: http://www.gnu.org/software/emacs/ License: GPLv2+ Group: Productivity/Editors/Emacs Version: 23.1 -Release: 21 +Release: 22 Obsoletes: ge_exec ge_site emac_nox emacmisc emacsbin emacsger emacs-url Mule-UCS emacs-calc erc Requires: emacs-info = %{version} Requires: emacs_program = %{version}-%{release} @@ -66,6 +66,8 @@ Patch18: emacs-sparc.diff Patch19: emacs-23.1-fix_cpp.patch Patch20: emacs-23.1-gcc45.dif Patch21: emacs-23.1-png_sig_cmp.patch +Patch22: emacs-23.1-bnc628268.patch +Patch23: emacs-23.1-rst.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global bug_345669 0 %{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)} @@ -260,6 +262,8 @@ if test ! -e $HOME/.mh_profile && type -p install-mh > /dev/null 2>&1; then fi %patch20 -p0 -b .gcc45 %patch21 +%patch22 +%patch23 %build CC=gcc-4.3