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

From: Leo <[email-masked]>
Date: Thu, 24 Feb 2011 12:46:40 +0800

On 2011-02-24 10:08 +0800, Glenn Morris wrote:
> As it stands, it emphatically should NOT be marked safe. Example:
[...]
>
> Oh dear, arbitrary shell command executed with permissions of the user
> running Emacs.

Looks like a bug in the way dired-actual-switches is used. Should we
devise a function to check every switch in dired-actual-switches is
actual a switch?

(defun dired-actual-switches-p (switches)
  (assert (stringp switches))
  (mapc
   (lambda (switch)
     (assert (eq (aref switch 0) ?-)))
   (split-string switches nil t)))

(put 'dired-actual-switches 'safe-local-variable 'dired-actual-switches-p)

Leo