From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.devel Subject: Re: Questions about XDG_RUNTIME_DIR and server-socket-dir Date: Mon, 04 Feb 2019 13:49:14 +0100 Message-ID: References: <32b703fc-e89c-23c3-cf21-74b4af6640f1@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="239409"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 04 13:50:08 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gqdhP-0010Af-Uw for ged-emacs-devel@m.gmane.org; Mon, 04 Feb 2019 13:50:08 +0100 Original-Received: from localhost ([127.0.0.1]:41985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqdhL-0001Yj-Vf for ged-emacs-devel@m.gmane.org; Mon, 04 Feb 2019 07:50:06 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqdhF-0001YN-1I for emacs-devel@gnu.org; Mon, 04 Feb 2019 07:49:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqdhD-00029Y-QJ for emacs-devel@gnu.org; Mon, 04 Feb 2019 07:49:56 -0500 Original-Received: from smtp.gentoo.org ([140.211.166.183]:60378) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqdhD-0001mv-Hw for emacs-devel@gnu.org; Mon, 04 Feb 2019 07:49:55 -0500 Original-Received: from a1i15 (host2092.kph.uni-mainz.de [134.93.134.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ulm) by smtp.gentoo.org (Postfix) with ESMTPSA id 681C0335D55; Mon, 4 Feb 2019 12:49:18 +0000 (UTC) In-Reply-To: <32b703fc-e89c-23c3-cf21-74b4af6640f1@cs.ucla.edu> (Paul Eggert's message of "Sat, 2 Feb 2019 22:10:24 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 140.211.166.183 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232960 Archived-At: >>>>> 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.