From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: Tassilo Horn <tassilo@member.fsf.org>, emacs-devel@gnu.org
Subject: Re: doc-view cache file permissions
Date: Tue, 30 Oct 2007 17:56:49 -0400 [thread overview]
Message-ID: <jwvejfcuv2x.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <7gk5p448xq.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 30 Oct 2007 16:57:37 -0400")
>> + ;; 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?
Could be. Although I might want to call it "make directory-secure"
since the point is to be able to use a "known" directory which may
already exist. Note that the code I just installed is simpler (and
safer). Also I'm not 100% that the code is actually safe. I'm pretty
sure it's safer.
Otherwise, if you really want a brand new directory, you can use
make-temp-file.
Stefan
next prev parent reply other threads:[~2007-10-30 21:56 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 18:50 doc-view cache file permissions Glenn Morris
2007-10-30 20:11 ` Stefan Monnier
2007-10-30 20:57 ` Glenn Morris
2007-10-30 21:56 ` Stefan Monnier [this message]
2007-10-31 7:22 ` Tassilo Horn
2007-10-31 7:56 ` Tassilo Horn
2007-10-31 15:10 ` Stefan Monnier
2007-10-31 17:46 ` Tassilo Horn
2007-10-31 18:21 ` Stefan Monnier
2007-10-31 19:44 ` Tassilo Horn
2007-10-31 20:41 ` Stefan Monnier
2007-11-02 20:44 ` Juri Linkov
2007-11-02 23:53 ` Tassilo Horn
2007-11-03 14:07 ` Stefan Monnier
2007-11-03 19:20 ` Tassilo Horn
2007-11-05 12:01 ` isearch for doc-view.el (was: doc-view cache file permissions) Tassilo Horn
2007-11-05 12:43 ` isearch for doc-view.el David Kastrup
2007-11-05 13:19 ` Tassilo Horn
2007-11-05 15:14 ` Stefan Monnier
2007-11-05 16:42 ` CEDET/senator kill the buffer-local value of isearch-search-fun-function (was: isearch for doc-view.el) Tassilo Horn
2007-11-05 21:01 ` isearch for doc-view.el Tassilo Horn
2007-11-05 21:20 ` Stefan Monnier
2007-11-05 21:51 ` Tassilo Horn
2007-11-06 0:44 ` Juri Linkov
2007-11-06 8:25 ` Tassilo Horn
2007-11-06 22:29 ` Juri Linkov
2007-11-07 8:41 ` Tassilo Horn
2007-11-10 21:57 ` Juri Linkov
2007-11-06 8:34 ` Tassilo Horn
2007-10-30 22:14 ` doc-view cache file permissions Reiner Steib
2007-10-31 0:52 ` Stefan Monnier
2007-10-30 20:34 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvejfcuv2x.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=rgm@gnu.org \
--cc=tassilo@member.fsf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.