aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fidler2012-12-29 18:26:14 +0800
committerChong Yidong2012-12-29 18:26:14 +0800
commitaf39894ab4b8a68eef14b39c030577b419a582a8 (patch)
tree8a3ca7b7bb98c86e148954d53b6292ad26db623f
parentd5b1b1aa9c12d3f14692fe9baf18e0997a019fe3 (diff)
downloademacs-af39894ab4b8a68eef14b39c030577b419a582a8.tar.gz
emacs-af39894ab4b8a68eef14b39c030577b419a582a8.zip
* emacs-lisp/package.el (package-untar-buffer): Handle problematic tarfile content listings.
Fixes: debbugs:13136
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/package.el6
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 43af9904859..4ed7103270e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-12-29 Matt Fidler <matt.fidler@alcon.com> (tiny change)
2
3 * emacs-lisp/package.el (package-untar-buffer): Handle problematic
4 tarfile content listings (Bug#13136).
5
12012-12-29 Mark Lillibridge <mark.lillibridge@hp.com> 62012-12-29 Mark Lillibridge <mark.lillibridge@hp.com>
2 7
3 * mail/rmailmm.el (rmail-insert-mime-forwarded-message): Insert 8 * mail/rmailmm.el (rmail-insert-mime-forwarded-message): Insert
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6629410a1f1..54d133b166c 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -604,7 +604,11 @@ untar into a directory named DIR; otherwise, signal an error."
604 (require 'tar-mode) 604 (require 'tar-mode)
605 (tar-mode) 605 (tar-mode)
606 ;; Make sure everything extracts into DIR. 606 ;; Make sure everything extracts into DIR.
607 (let ((regexp (concat "\\`" (regexp-quote dir) "/"))) 607 (let ((regexp (concat "\\`" (regexp-quote dir)
608 ;; Tarballs created by some utilities don't
609 ;; list directories with a trailing slash
610 ;; (Bug#13136).
611 "\\(/\\|\\'\\)")))
608 (dolist (tar-data tar-parse-info) 612 (dolist (tar-data tar-parse-info)
609 (unless (string-match regexp (aref tar-data 2)) 613 (unless (string-match regexp (aref tar-data 2))
610 (error "Package does not untar cleanly into directory %s/" dir)))) 614 (error "Package does not untar cleanly into directory %s/" dir))))