Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The directory `~/.emacs.d/server' is unsafe #291

Closed
new-xd opened this issue Aug 24, 2015 · 4 comments
Closed

The directory `~/.emacs.d/server' is unsafe #291

new-xd opened this issue Aug 24, 2015 · 4 comments

Comments

@new-xd
Copy link

new-xd commented Aug 24, 2015

OS: windows7
Emacs: emacs-24.5-bin-i686-mingw32.zip
error log:

Debugger entered--Lisp error: (error "The directory `~/.emacs.d/server' is unsafe")
  signal(error ("The directory `~/.emacs.d/server' is unsafe"))
  error("The directory `%s' is unsafe" "~/.emacs.d/server")
  server-ensure-safe-dir("~\\.emacs.d\\server\\")
  server-start()
  (if (server-running-p) nil (server-start))
  eval-buffer(#<buffer  *load*> nil "e:/Home/.emacs.d/init.el" nil t)  ; Reading at buffer position 3628
  load-with-code-conversion("e:/Home/.emacs.d/init.el" "e:/Home/.emacs.d/init.el" t t)
  load("e:/Home/.emacs.d/init" t t)
  #[0 "^H\205\262...a lot of number here,but I can not copy them ..."[init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
  command-line()
  normal-top-level()
@purcell
Copy link
Owner

purcell commented Aug 26, 2015

I haven't modified anything relating to the emacs server in this config, so I don't think this is something I'd need to fix here. :-)

This docstring in Emacs' "server.el" seems to indicate that the problem might be your filesystem:

(defcustom server-auth-dir (locate-user-emacs-file "server/")
  "Directory for server authentication files.
We only use this if `server-use-tcp' is non-nil.
Otherwise we use `server-socket-dir'.

NOTE: On FAT32 filesystems, directories are not secure;
files can be read and modified by any user or process.
It is strongly suggested to set `server-auth-dir' to a
directory residing in a NTFS partition instead."
  :group 'server
  :type 'directory
  :version "22.1")

@new-xd
Copy link
Author

new-xd commented Aug 27, 2015

Thank you for reply.
I just found a solution: http://tieba.baidu.com/p/3423825708
And it works.
Reason: the owner of the directory is not the current user.
Solution: right click server directory -> Properties -> security -> Advanced -> Owner -> Edit, then change the owner to the current user. Finally restart Emacs and the error is gone.

@new-xd new-xd closed this as completed Aug 27, 2015
@purcell
Copy link
Owner

purcell commented Aug 27, 2015

Super - glad you figured it out. :-)

@cryptcyber
Copy link

Great! It worked. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants