aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/doc-view.el29
2 files changed, 20 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6ac0dd3d0b1..48f61a55552 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org> 12011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 2
3 * doc-view.el (doc-view-make-safe-dir): Rewrite the error message
4 to clarify what the problem is (bug#4291).
5
3 * simple.el (current-kill): Clarify what 6 * simple.el (current-kill): Clarify what
4 `interprogram-paste-function' does (bug#7500). 7 `interprogram-paste-function' does (bug#7500).
5 (auto-fill-mode): Document `auto-fill-function' in relation to 8 (auto-fill-mode): Document `auto-fill-function' in relation to
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 666c6a8b034..872b2172c7e 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -569,18 +569,18 @@ at the top edge of the page moves to the previous page."
569(defun doc-view-make-safe-dir (dir) 569(defun doc-view-make-safe-dir (dir)
570 (condition-case nil 570 (condition-case nil
571 (let ((umask (default-file-modes))) 571 (let ((umask (default-file-modes)))
572 (unwind-protect 572 (unwind-protect
573 (progn 573 (progn
574 ;; Create temp files with strict access rights. It's easy to 574 ;; Create temp files with strict access rights. It's easy to
575 ;; loosen them later, whereas it's impossible to close the 575 ;; loosen them later, whereas it's impossible to close the
576 ;; time-window of loose permissions otherwise. 576 ;; time-window of loose permissions otherwise.
577 (set-default-file-modes #o0700) 577 (set-default-file-modes #o0700)
578 (make-directory dir)) 578 (make-directory dir))
579 ;; Reset the umask. 579 ;; Reset the umask.
580 (set-default-file-modes umask))) 580 (set-default-file-modes umask)))
581 (file-already-exists 581 (file-already-exists
582 (if (file-symlink-p dir) 582 (when (file-symlink-p dir)
583 (error "Danger: %s points to a symbolic link" dir)) 583 (error "Danger: %s points to a symbolic link" dir))
584 ;; In case it was created earlier with looser rights. 584 ;; In case it was created earlier with looser rights.
585 ;; We could check the mode info returned by file-attributes, but it's 585 ;; We could check the mode info returned by file-attributes, but it's
586 ;; a pain to parse and it may not tell you what we want under 586 ;; a pain to parse and it may not tell you what we want under
@@ -589,7 +589,12 @@ at the top edge of the page moves to the previous page."
589 ;; This also ends up checking a bunch of useful conditions: it makes 589 ;; This also ends up checking a bunch of useful conditions: it makes
590 ;; sure we have write-access to the directory and that we own it, thus 590 ;; sure we have write-access to the directory and that we own it, thus
591 ;; closing a bunch of security holes. 591 ;; closing a bunch of security holes.
592 (set-file-modes dir #o0700)))) 592 (condition-case error
593 (set-file-modes dir #o0700)
594 (file-error
595 (error
596 (format "Unable to use temporary directory %s: %s"
597 dir (mapconcat 'identity (cdr error) " "))))))))
593 598
594(defun doc-view-current-cache-dir () 599(defun doc-view-current-cache-dir ()
595 "Return the directory where the png files of the current doc should be saved. 600 "Return the directory where the png files of the current doc should be saved.