[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36598: 26.1; (error "‘/tmp/emacs1000’ is not a safe directory becaus

From: Lars Ingebrigtsen
Subject: bug#36598: 26.1; (error "‘/tmp/emacs1000’ is not a safe directory because it is a symlink")
Date: Sat, 13 Jul 2019 15:06:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Noam Postavsky <address@hidden> writes:

> address@hidden (Mark A. Hershberger) writes:
>> $ ls -l /tmp/emacs1000
>> lrwxrwxrwx 1 mah mah 20 Jul 11 09:53 /tmp/emacs1000 -> /run/user/1000/emacs
>> Whoever set up the symlink for /tmp/emacs1000
> Do you know who that is?

It's probably this code?  But it works for me; it just sets up a symlink
from /tmp for compatibility with older emacsclients, I think?

(defun server-ensure-safe-dir (dir)


    (let ((olddir (or (getenv "TMPDIR") "/tmp")))
      (when (and (equal dir (format "%s/emacs" (getenv "XDG_RUNTIME_DIR")))
                 (file-writable-p olddir))
        (let ((link (format "%s/emacs%d" olddir (user-uid))))
          (unless (file-directory-p link)
            ;; We're using the new location, so try and setup a symlink from
            ;; the old location, in case we want to use an old emacsclient.
            ;; FIXME: Check that it's safe to use!
            (make-symbolic-link dir link t)))))

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

[Prev in Thread] Current Thread [Next in Thread]