bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3230: 23.0.93; Make dired-actual-switches safe local variable?


From: Leo
Subject: bug#3230: 23.0.93; Make dired-actual-switches safe local variable?
Date: Fri, 25 Feb 2011 22:38:21 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.94 (Mac OS X 10.6.6)

On 2011-02-24 22:57 +0800, Stefan Monnier wrote:
> Hmm, what about "-l;reboot" ?

Thanks.

> BTW, writing a predicate is the right thing to so, and the predicate
> should then go to safe-local-variable.  I'd recommend something simple
> like
>
>   (defun dired-safe-switches-p (switches)
>     (string-match "\\`[- [[:alnum:]]]+\\'" switches))

A typo: should be [:alnum:].

> Hopefully that one is safe (tho maybe we should check string-length to
> avoid attacks playing on overflow).  And if it proves too restrictive,
> we can make it a bit more permissive once we encounter a particular
> example that warrants it.
>
>         Stefan

I think I like this. Glenn, would you agree to this?

If this is accepted, I have one use case that can be easily done:

I have one directory where I file regularly. I like that directory to be
sorted by time instead of by name in dired. This change will allow me to
set dired-actual-switches to achieve that.

Leo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]