[Top][All Lists]

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

Re: Questions about XDG_RUNTIME_DIR and server-socket-dir

From: Ulrich Mueller
Subject: Re: Questions about XDG_RUNTIME_DIR and server-socket-dir
Date: Mon, 04 Feb 2019 13:49:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>>>>> On Sun, 03 Feb 2019, Paul Eggert wrote:

> XDG_RUNTIME_DIR is a per-user-login directory that is like TMPDIR
> except without some of the security problems of TMPDIR (e.g., an
> attacker can create a symlink in TMPDIR to some victim location). That
> is, XDG_RUNTIME_DIR is accessible only to you, whereas TMPDIR
> traditionally is world-accessible. Also, XDG_RUNTIME_DIR's lifetime is
> intended to be just while the user is logged in. For more, please see:

> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

That limited lifetime is also one of its problems, as I had already
pointed out in bug #33847. XDG_RUNTIME_DIR will disappear when the login
session ends, leading to an Emacs daemon process that has no socket and
can no longer be connected to. However, I suspect that some peoples'
workflow includes an Emacs daemon process that persists their login
session, which is no longer possible with the new location (at least not
in the default configuration).

> I don't see the harm in changing it, if each new setting is intended
> to correspond to a different user login. That might be simpler than
> adding yet another environment variable.

I had suggested (including a patch) in bug #33847 that the client should
fall back to TMPDIR if it doesn't find the socket in XDG_RUNTIME_DIR.
That way, the daemon could started from an environment without
XDG_RUNTIME_DIR (i.e., with the socket in TMPDIR, persisting login
sessions), and emacsclient would still find the socket, even if the
users started it from a GUI session.

reply via email to

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