मुझे लगभग 18 साल पहले एक दोस्त से मेरी .emacs फ़ाइल विरासत में मिली। enable-local-variables
सुविधा के सुरक्षा निहितार्थों के बारे में चेतावनी के बीच में दफन निम्नलिखित अशुभ टिप्पणी चेतावनी है :
;; Date: Wed, 7 Dec 1994 11:57:50 -0600
;; From: blob@syl.dl.nec.com (David Blob)
;; Subject: Self-extracting emacs elisp code
;;
;; With all this talk about self extracting mail "viruses", a friend
;; showed me that in emacs (which I use to read mail, along with vm)
;; has the ability to self-extract elisp code. This feature seems to
;; be turned on by default, and it not only applies to mail read with
;; emacs, but rather every file visited (when the feature is on, of
;; course).
;;
;; The way it works is by having a line which reads "Local Variables:"
;; followed by the lisp variables you would like to set...well, it may
;; seem petty, but you can execute programs, make connections and much
;; more through cleverly written elisp code contained within.
;;
;; It's simple to turn off, at any rate...
;;
;; (setq enable-local-variables f) ;; turns off feature (in emacs 19)
;; (setq enable-local-variables 1) ;; makes it ask first (in emacs 19)
;; (setq inhibit-local-variables t) ;; turns off feature (in emacs 18)
;;
;; Anyhow, I think the risks here speak for themselves...
;;
(setq enable-local-variables '())
इसलिए मैंने वास्तव में कभी local-variables
भी सुविधा का उपयोग नहीं किया है , भले ही ऐसा लगता है कि यह बहुत उपयोगी हो सकता है। वहाँ एक तरीका है enable-local-variables
कि मुझे अनियंत्रित कोड-इंजेक्शन हमलों के लिए उजागर किए बिना कुछ उपयोगी है?