all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* make defcustom automatically mark some variables as safe
@ 2007-10-25  4:09 Glenn Morris
  2007-10-26  1:18 ` Stefan Monnier
  2007-10-26  3:49 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Glenn Morris @ 2007-10-25  4:09 UTC (permalink / raw)
  To: emacs-devel


What do people think of the idea of changing defcustom to give
some variable types a safe-local-variable property by default?

I mean that, eg, defcustom'ing a variable of :type integer would do:
(put 'variable 'safe-local-variable 'integerp)

Similarly for :type boolean (booleanp), string and regexp (stringp),
and others where it makes sense.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make defcustom automatically mark some variables as safe
  2007-10-25  4:09 make defcustom automatically mark some variables as safe Glenn Morris
@ 2007-10-26  1:18 ` Stefan Monnier
  2007-10-26  2:50   ` Glenn Morris
  2007-10-26  3:49 ` Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2007-10-26  1:18 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

> What do people think of the idea of changing defcustom to give
> some variable types a safe-local-variable property by default?

> I mean that, eg, defcustom'ing a variable of :type integer would do:
> (put 'variable 'safe-local-variable 'integerp)

> Similarly for :type boolean (booleanp), string and regexp (stringp),
> and others where it makes sense.

I think this is wrong: one of the main changes in Emacs-22 w.r.t file-local
variables is that we made them safe: from no on, a file-local variable
should never be blindly accepted if we're not "sure" that it's safe.

So this would be a step backward since it would usually make good decisions
but not always (e.g. `enable-local-eval' could very well have been defined
with `:type boolean') so that would introduce security holes until someone
notices them.


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make defcustom automatically mark some variables as safe
  2007-10-26  1:18 ` Stefan Monnier
@ 2007-10-26  2:50   ` Glenn Morris
  0 siblings, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2007-10-26  2:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier wrote:

> So this would be a step backward since it would usually make good decisions
> but not always (e.g. `enable-local-eval' could very well have been defined
> with `:type boolean') so that would introduce security holes until someone
> notices them.

Ouch. It was a stupid suggestion, forget it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: make defcustom automatically mark some variables as safe
  2007-10-25  4:09 make defcustom automatically mark some variables as safe Glenn Morris
  2007-10-26  1:18 ` Stefan Monnier
@ 2007-10-26  3:49 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-10-26  3:49 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

    What do people think of the idea of changing defcustom to give
    some variable types a safe-local-variable property by default?

    I mean that, eg, defcustom'ing a variable of :type integer would do:
    (put 'variable 'safe-local-variable 'integerp)

It is dangerous.  We want people to think about each variable,
so we don't want any feature that would encourage people not to.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-26  3:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25  4:09 make defcustom automatically mark some variables as safe Glenn Morris
2007-10-26  1:18 ` Stefan Monnier
2007-10-26  2:50   ` Glenn Morris
2007-10-26  3:49 ` Richard Stallman

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.