|
From: | Glenn Morris |
Subject: | Re: doc-view cache file permissions |
Date: | Tue, 30 Oct 2007 16:57:37 -0400 |
User-agent: | Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Stefan Monnier wrote: > + ;; Try and make sure doc-view-cache-directory exists and is safe. > + (condition-case nil > + (make-directory doc-view-cache-directory) > + (file-already-exists > + (cond > + ((file-symlink-p doc-view-cache-directory) > + (error "Danger: doc-view-cache-directory points to a symbolic > link")) > + ((not (file-directory-p doc-view-cache-directory)) > + (error "doc-view-cache-directory is not a directory")) > + ((not (file-writable-p doc-view-cache-directory)) > + (error "Cannot write to doc-view-cache-directory")) > + ((not (= (user-uid) (nth 2 (file-attributes > doc-view-cache-directory)))) > + (error "Danger: doc-view-cache-directory does not belong to us"))))) Is that worthy of being the basis of a more generally available `make-secure-directory' function?
[Prev in Thread] | Current Thread | [Next in Thread] |