EmacsはGNU/Linuxのようなオペレーティングシステムの内部で実行され、ファイルアクセスのようなセキュリティー制限のチェックはオペレーティングシステムに依存します。Emacsのデフォルトセッティングは、通常の使用のためにデザインされています。通常よりセキュリティーが重要な場合、または重要でない環境では、何らかの調整が必要になるでしょう。たとえばファイルローカル変数(file-local
variables)が危険な場合もあるので、変数enable-local-variablesに:safeや、(より安全に)nilをセットできます。ファイルがすべて信用でき、それらの変数にたいするデフォルトのチェックが煩わしいときには、enable-local-variablesに:allをセットできます。安全なファイル変数を参照してください。
Loading a file of Emacs Lisp code with load-file or
load-library (see EmacsのためのLispコードによるライブラリー) can execute some of the Lisp
code in the file being loaded, so you should only load Lisp files whose
source you trust. However, some Emacs features can in certain situations
execute Lisp code even without your explicit command or request. For
example, Flymake, the on-the-fly syntax checker for Emacs (see GNU Flymake), if it is enabled, can automatically execute some of
the code in a Lisp file you visit as part of its syntax-checking job.
Similarly, some completion commands (see 補完) in buffers visiting
Lisp files sometimes need to expand Lisp macros for best results. In these
cases, just visiting a Lisp file and performing some editing in it could
trigger execution of Lisp code. If the visited file came from an untrusted
source, it could include dangerous or even malicious code that Emacs would
execute in those situations.
To protect against this, Emacs disables execution of Lisp code by Flymake,
completion, and some other features, unless the visited file is
trusted. It is up to you to specify which files on your system should
be trusted, by customizing the user option trusted-content.
The value of this option is nil by default, which means no file is
trusted. You can customize the variable to be a list of one or more names
of trusted files and directories. A file name that ends in a slash /
is interpreted as a directory, which means all its files and subdirectories
are also trusted. A special value :all means all the files
and directories on your system should be trusted; this is not
recommended, as it opens a gaping security hole.
大きなアプリケーションの一部としてEmacsを使用する場合の、セキュリティー考慮についての情報は、Security Considerations in The Emacs Lisp Reference Manualを参照してください。