unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: mah@everybody.org, 36598@debbugs.gnu.org
Subject: bug#36598: 26.1; (error "‘/tmp/emacs1000’ is not a safe directory because it is a symlink")
Date: Sat, 13 Jul 2019 16:56:19 +0100	[thread overview]
Message-ID: <44a502116d2c0568d120b7328913b26a@russet.org.uk> (raw)
In-Reply-To: <m3zhlingch.fsf@gnus.org>

On 2019-07-13 15:45, Lars Ingebrigtsen wrote:
> phillip.lord@russet.org.uk writes:
> 
>> Launch emacs-27, start the server. Now launch emacs-26 and start the
>> server with a different. The problem is that
>> emacs-27 creates the file /tmp/emacs($PID) as a symlink, while
>> emacs-26 doesn't like it.
>> 
>> Probably created by
>> 
>> b663c837249 (Stefan Monnier          2019-05-03  538)
> 
> Could you post a backtrace for the "doesn't like it" case?

Sure. It is Emacs-26 that errors.

As far as I can see, this will only affect the edge case of someone 
running two versions of Emacs. I tend to do this (I run gnus in a 
standalone release emacs, and everything else in another emacs).

Phil


Debugger entered--Lisp error: (error "‘/tmp/emacs1000’ is not a safe 
directory because it is a symlink")
   signal(error ("‘/tmp/emacs1000’ is not a safe directory because it is 
a symlink"))
   error("`%s' is not a safe directory because %s" "/tmp/emacs1000" "it 
is a symlink")
   (progn (error "`%s' is not a safe directory because %s" 
(expand-file-name dir) unsafe))
   (if unsafe (progn (error "`%s' is not a safe directory because %s" 
(expand-file-name dir) unsafe)))
   (let* ((uid (nth 2 attrs)) (w32 (eq system-type (quote windows-nt))) 
(unsafe (cond ((not (eq t (car attrs))) (if (null attrs) "its attributes 
can't be checked" (format "it is a %s" (if ... "symlink" "file")))) 
((and w32 (= 0 uid)) (display-warning (quote server) (format-message 
"Using `%s' to store Emacs-server authentication files.\nDirectories on 
FAT32 filesystems are NOT secure against tampering.\nSee variable 
`server-auth-dir' for details." (file-name-as-directory dir)) :warning) 
nil) ((and (/= uid (user-uid)) (or (not w32) (/= uid 544) (/= ... 500))) 
(format "it is not owned by you (owner = %s (%d))" (user-full-name uid) 
uid)) (w32 nil) ((/= 0 (logand 63 (file-modes dir))) (format "it is 
accessible by others (%03o)" (file-modes dir))) (t nil)))) (if unsafe 
(progn (error "`%s' is not a safe directory because %s" 
(expand-file-name dir) unsafe))))
   (let ((attrs (file-attributes dir (quote integer)))) (if attrs nil 
(let* ((old (default-file-modes))) (unwind-protect (progn (progn 
(set-default-file-modes 448) 448) (make-directory dir t)) (let* ((v 
old)) (progn (set-default-file-modes v) v)))) (setq attrs 
(file-attributes dir (quote integer)))) (let* ((uid (nth 2 attrs)) (w32 
(eq system-type (quote windows-nt))) (unsafe (cond ((not (eq t ...)) (if 
(null attrs) "its attributes can't be checked" (format "it is a %s" 
...))) ((and w32 (= 0 uid)) (display-warning (quote server) 
(format-message "Using `%s' to store Emacs-server authentication 
files.\nDirectories on FAT32 filesystems are NOT secure against 
tampering.\nSee variable `server-auth-dir' for details." ...) :warning) 
nil) ((and (/= uid ...) (or ... ... ...)) (format "it is not owned by 
you (owner = %s (%d))" (user-full-name uid) uid)) (w32 nil) ((/= 0 
(logand 63 ...)) (format "it is accessible by others (%03o)" (file-modes 
dir))) (t nil)))) (if unsafe (progn (error "`%s' is not a safe directory 
because %s" (expand-file-name dir) unsafe)))))
   server-ensure-safe-dir("/tmp/emacs1000")
   (if leave-dead (progn (if (eq t leave-dead) nil (server-log (message 
"Server stopped"))) (setq server-process nil)) (server-ensure-safe-dir 
server-dir) (if server-process (progn (server-log (message "Restarting 
server")))) (let* ((old (default-file-modes))) (unwind-protect (progn 
(progn (set-default-file-modes 448) 448) (add-hook (quote 
suspend-tty-functions) (quote server-handle-suspend-tty)) (add-hook 
(quote delete-frame-functions) (quote server-handle-delete-frame)) 
(add-hook (quote kill-emacs-query-functions) (quote 
server-kill-emacs-query-function)) (add-hook (quote kill-emacs-hook) 
(quote server-force-stop) t) (setq server-process (apply (function 
make-network-process) :name server-name :server t :noquery t :sentinel 
(function server-sentinel) :filter (function server-process-filter) 
:use-external-socket t :coding (quote raw-text-unix) (if server-use-tcp 
(list :family ... :service ... :host ... :plist ...) (list :family ... 
:service server-file :plist ...)))) (if server-process nil (error "Could 
not start server process")) (process-put server-process :server-file 
server-file) (if server-use-tcp (progn (let (...) (process-put 
server-process :auth-key auth-key) (let ... ...))))) (let* ((v old)) 
(progn (set-default-file-modes v) v)))))
   (let* ((server-dir (if server-use-tcp server-auth-dir 
server-socket-dir)) (server-file (expand-file-name server-name 
server-dir))) (if server-process (progn (condition-case nil (progn 
(delete-process server-process)) (error nil)))) (if (not (eq t 
(server-running-p server-name))) (condition-case nil (progn (let 
(delete-by-moving-to-trash) (delete-file server-file))) (error nil)) 
(setq server-mode nil) (display-warning (quote server) (concat "Unable 
to start the Emacs server.\n" (format "There is an existing Emacs 
server, named %S.\n" server-name) (substitute-command-keys "To start the 
server in this Emacs process, stop the existing\nserver or call 
`\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq 
leave-dead t)) (while server-clients (server-delete-client (car 
server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil 
(server-log (message "Server stopped"))) (setq server-process nil)) 
(server-ensure-safe-dir server-dir) (if server-process (progn 
(server-log (message "Restarting server")))) (let* ((old 
(default-file-modes))) (unwind-protect (progn (progn 
(set-default-file-modes 448) 448) (add-hook (quote 
suspend-tty-functions) (quote server-handle-suspend-tty)) (add-hook 
(quote delete-frame-functions) (quote server-handle-delete-frame)) 
(add-hook (quote kill-emacs-query-functions) (quote 
server-kill-emacs-query-function)) (add-hook (quote kill-emacs-hook) 
(quote server-force-stop) t) (setq server-process (apply (function 
make-network-process) :name server-name :server t :noquery t :sentinel 
(function server-sentinel) :filter (function server-process-filter) 
:use-external-socket t :coding (quote raw-text-unix) (if server-use-tcp 
... ...))) (if server-process nil (error "Could not start server 
process")) (process-put server-process :server-file server-file) (if 
server-use-tcp (progn (let ... ... ...)))) (let* ((v old)) (progn 
(set-default-file-modes v) v))))))
   (progn (let* ((server-dir (if server-use-tcp server-auth-dir 
server-socket-dir)) (server-file (expand-file-name server-name 
server-dir))) (if server-process (progn (condition-case nil (progn 
(delete-process server-process)) (error nil)))) (if (not (eq t 
(server-running-p server-name))) (condition-case nil (progn (let 
(delete-by-moving-to-trash) (delete-file server-file))) (error nil)) 
(setq server-mode nil) (display-warning (quote server) (concat "Unable 
to start the Emacs server.\n" (format "There is an existing Emacs 
server, named %S.\n" server-name) (substitute-command-keys "To start the 
server in this Emacs process, stop the existing\nserver or call 
`\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq 
leave-dead t)) (while server-clients (server-delete-client (car 
server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil 
(server-log (message "Server stopped"))) (setq server-process nil)) 
(server-ensure-safe-dir server-dir) (if server-process (progn 
(server-log (message "Restarting server")))) (let* ((old 
(default-file-modes))) (unwind-protect (progn (progn 
(set-default-file-modes 448) 448) (add-hook (quote 
suspend-tty-functions) (quote server-handle-suspend-tty)) (add-hook 
(quote delete-frame-functions) (quote server-handle-delete-frame)) 
(add-hook (quote kill-emacs-query-functions) (quote 
server-kill-emacs-query-function)) (add-hook (quote kill-emacs-hook) 
(quote server-force-stop) t) (setq server-process (apply ... :name 
server-name :server t :noquery t :sentinel ... :filter ... 
:use-external-socket t :coding ... ...)) (if server-process nil (error 
"Could not start server process")) (process-put server-process 
:server-file server-file) (if server-use-tcp (progn ...))) (let* ((v 
old)) (progn (set-default-file-modes v) v)))))))
   (if (or (not server-clients) (cond ((and (daemonp) (null (cdr 
(frame-list))) (eq (selected-frame) terminal-frame)) leave-dead) 
(inhibit-prompt t) (t (yes-or-no-p "The current server still has 
clients; delete them? ")))) (progn (let* ((server-dir (if server-use-tcp 
server-auth-dir server-socket-dir)) (server-file (expand-file-name 
server-name server-dir))) (if server-process (progn (condition-case nil 
(progn (delete-process server-process)) (error nil)))) (if (not (eq t 
(server-running-p server-name))) (condition-case nil (progn (let 
(delete-by-moving-to-trash) (delete-file server-file))) (error nil)) 
(setq server-mode nil) (display-warning (quote server) (concat "Unable 
to start the Emacs server.\n" (format "There is an existing Emacs 
server, named %S.\n" server-name) (substitute-command-keys "To start the 
server in this Emacs process, stop the existing\nserver or call 
`\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq 
leave-dead t)) (while server-clients (server-delete-client (car 
server-clients))) (if leave-dead (progn (if (eq t leave-dead) nil 
(server-log (message "Server stopped"))) (setq server-process nil)) 
(server-ensure-safe-dir server-dir) (if server-process (progn 
(server-log (message "Restarting server")))) (let* ((old 
(default-file-modes))) (unwind-protect (progn (progn ... 448) (add-hook 
... ...) (add-hook ... ...) (add-hook ... ...) (add-hook ... ... t) 
(setq server-process ...) (if server-process nil ...) (process-put 
server-process :server-file server-file) (if server-use-tcp ...)) (let* 
(...) (progn ... v))))))))
   server-start(nil)
   funcall-interactively(server-start nil)
   call-interactively(server-start record nil)
   command-execute(server-start record)
   execute-extended-command(nil "server-start" "server-start")
   funcall-interactively(execute-extended-command nil "server-start" 
"server-start")
   call-interactively(execute-extended-command nil nil)
   command-execute(execute-extended-command)





  reply	other threads:[~2019-07-13 15:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 14:10 bug#36598: 26.1; (error "‘/tmp/emacs1000’ is not a safe directory because it is a symlink") Mark A. Hershberger
2019-07-13  4:38 ` Lars Ingebrigtsen
2019-07-13 14:30   ` phillip.lord
2019-07-13 14:45     ` Lars Ingebrigtsen
2019-07-13 15:56       ` phillip.lord [this message]
2019-07-14  1:43         ` Glenn Morris
2019-07-14 11:44         ` Lars Ingebrigtsen
2019-07-14 19:11           ` phillip.lord
2019-07-15 13:04             ` Stefan Monnier
2019-07-18  6:27               ` Eli Zaretskii
2019-07-23 12:07                 ` Noam Postavsky
2019-07-13 12:46 ` Noam Postavsky
2019-07-13 13:06   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44a502116d2c0568d120b7328913b26a@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=36598@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mah@everybody.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).