GNU bug report logs - #33847
27.0.50; emacsclient does not find server socket

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Ulrich Mueller <ulm@HIDDEN>; dated Sun, 23 Dec 2018 09:49:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 30 Dec 2018 06:45:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 30 01:45:09 2018
Received: from localhost ([127.0.0.1]:41791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gdUqT-0004wP-DT
	for submit <at> debbugs.gnu.org; Sun, 30 Dec 2018 01:45:09 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gdUqQ-0004pI-Gw
 for 33847 <at> debbugs.gnu.org; Sun, 30 Dec 2018 01:45:07 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 508D8160DFF;
 Sat, 29 Dec 2018 22:45:00 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id L2PEvhoG7GlL; Sat, 29 Dec 2018 22:44:59 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 94705160E16;
 Sat, 29 Dec 2018 22:44:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id l7j0uYec8QxO; Sat, 29 Dec 2018 22:44:59 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6AD8F160DFF;
 Sat, 29 Dec 2018 22:44:59 -0800 (PST)
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
To: Ulrich Mueller <ulm@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
 <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
 <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN>
 <w6gd0pm41ic.fsf@HIDDEN>
 <fb7b029e-e786-077d-9aab-b3047797b5e2@HIDDEN>
 <w6g4lay3zzx.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <e293a1e9-e042-bb42-6b40-d887d60d98c5@HIDDEN>
Date: Sat, 29 Dec 2018 22:44:59 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <w6g4lay3zzx.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich Mueller wrote:
> So you're saying that on systems that don't have XDG_RUNTIME_DIR,
> placing the socket under TMPDIR is fine? Because I don't understand
> that argument. If TMPDIR has security problem, then it shouldn't be
> used anywhere. If it hasn't, then why can't we keep the current
> (Emacs 26) solution?

Because we're not absolutists. On older systems that do not have adequate 
provisions for security, Emacs does the best it can: that's better than not 
doing anything, and people who run older, less-secure systems are likely to not 
care all that much about security anyway so this is OK. On newer systems that 
are more secure, though, Emacs can be more secure.

This is not anything new. In the bad old days when /tmp wasn't sticky, Emacs was 
less secure with temporary files, just like everyone else was. That didn't mean 
that Emacs should never have used temporary files.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 28 Dec 2018 06:51:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 28 01:51:58 2018
Received: from localhost ([127.0.0.1]:39682 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gclzy-0004ZH-15
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:51:58 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:46812)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gclzw-0004Z4-Tq
 for 33847 <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:51:57 -0500
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 F2A29335C5D;
 Fri, 28 Dec 2018 06:51:49 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
 <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
 <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN>
 <w6gd0pm41ic.fsf@HIDDEN>
 <fb7b029e-e786-077d-9aab-b3047797b5e2@HIDDEN>
Date: Fri, 28 Dec 2018 07:51:46 +0100
In-Reply-To: <fb7b029e-e786-077d-9aab-b3047797b5e2@HIDDEN> (Paul Eggert's
 message of "Thu, 27 Dec 2018 22:35:12 -0800")
Message-ID: <w6g4lay3zzx.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Fri, 28 Dec 2018, Paul Eggert wrote:

> We don't need to attack the problem in general, only the problem on
> platforms that have XDG_RUNTIME_DIR. What sort of platforms have
> XDG_RUNTIME_DIR but do not use systemd, and how does one start a
> user-specific server on such platforms?

See my original report, OpenRC and start-stop-daemon.

So you're saying that on systems that don't have XDG_RUNTIME_DIR,
placing the socket under TMPDIR is fine? Because I don't understand
that argument. If TMPDIR has security problem, then it shouldn't be
used anywhere. If it hasn't, then why can't we keep the current
(Emacs 26) solution?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 28 Dec 2018 06:38:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 28 01:38:06 2018
Received: from localhost ([127.0.0.1]:39678 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gclmY-0004Fb-MN
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:38:06 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:46084)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gclmT-0004F4-Vj
 for 33847 <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:38:02 -0500
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 3D075335C3D;
 Fri, 28 Dec 2018 06:37:55 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <w6gtvj13tuh.fsf@HIDDEN>
 <476852d0-9cd6-a6ae-a11d-bb4d761323da@HIDDEN>
 <w6gmuos48xl.fsf@HIDDEN>
 <cfa82784-a804-07ba-7d5a-d4ab5d05cf96@HIDDEN>
Date: Fri, 28 Dec 2018 07:37:52 +0100
In-Reply-To: <cfa82784-a804-07ba-7d5a-d4ab5d05cf96@HIDDEN> (Paul Eggert's
 message of "Wed, 26 Dec 2018 10:32:19 -0800")
Message-ID: <w6g8t0a40n3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Wed, 26 Dec 2018, Paul Eggert wrote:

>> can't the socket be placed in ${HOME}/.emacs.d/ which is already used
>> in the TCP case? The socket could be named server-<system-name>, in
>> order to avoid issues with NFS mounted directories.

> That would cause problems when Emacs crashes or the system reboots,
> since the directory wouldn't be cleaned up automatically. So although
> we could add this as an option, I'm a bit leery of making it the
> default.

The only problem I see is that it would leave a stale socket file
behind, when Emacs is not properly terminated. That file would be
deleted/replaced the next time an Emacs server is started.

I guess in the typical use case we are talking about a single inode.
If the home directory is NFS mounted it may be one inode per machine.
I think that's a small price to pay, for a solution that would be both
very simple, would be available on all systems, and won't suffer from
security issues.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 28 Dec 2018 06:35:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 28 01:35:20 2018
Received: from localhost ([127.0.0.1]:39675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcljs-0004Bi-7Y
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:35:20 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55270)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gcljq-0004BW-VE
 for 33847 <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:35:19 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5FC76160D7B;
 Thu, 27 Dec 2018 22:35:13 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id f61UBOQZfYTZ; Thu, 27 Dec 2018 22:35:12 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 76555160DFD;
 Thu, 27 Dec 2018 22:35:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 1eO7QY_1eiYD; Thu, 27 Dec 2018 22:35:12 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 52C0F160A6F;
 Thu, 27 Dec 2018 22:35:12 -0800 (PST)
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
To: Ulrich Mueller <ulm@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
 <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
 <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN>
 <w6gd0pm41ic.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <fb7b029e-e786-077d-9aab-b3047797b5e2@HIDDEN>
Date: Thu, 27 Dec 2018 22:35:12 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <w6gd0pm41ic.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich Mueller wrote:
>> Ulrich, have you tried starting your Emacs server as a lingering
>> service? Lingering seems to be designed for the sort of thing you want
>> to do. Look for "enable-linger" in
>> <https://www.freedesktop.org/software/systemd/man/loginctl.html>.
> That would require systemd, so it is not a solution that can be
> universally used. Especially it is GNU/Linux specific.

We don't need to attack the problem in general, only the problem on platforms 
that have XDG_RUNTIME_DIR. What sort of platforms have XDG_RUNTIME_DIR but do 
not use systemd, and how does one start a user-specific server on such platforms?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 28 Dec 2018 06:19:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 28 01:19:22 2018
Received: from localhost ([127.0.0.1]:39672 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gclUP-0003jv-Pf
	for submit <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:19:21 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:44930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gclUN-0003jd-3r
 for 33847 <at> debbugs.gnu.org; Fri, 28 Dec 2018 01:19:20 -0500
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 CF455335C5D;
 Fri, 28 Dec 2018 06:19:11 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
 <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
 <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN>
Date: Fri, 28 Dec 2018 07:19:07 +0100
In-Reply-To: <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN> (Paul Eggert's
 message of "Thu, 27 Dec 2018 09:13:13 -0800")
Message-ID: <w6gd0pm41ic.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Thu, 27 Dec 2018, Paul Eggert wrote:

> Ulrich, have you tried starting your Emacs server as a lingering
> service? Lingering seems to be designed for the sort of thing you want
> to do. Look for "enable-linger" in
> <https://www.freedesktop.org/software/systemd/man/loginctl.html>.

That would require systemd, so it is not a solution that can be
universally used. Especially it is GNU/Linux specific.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 27 Dec 2018 17:13:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 12:13:22 2018
Received: from localhost ([127.0.0.1]:39506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcZDm-0005jy-GJ
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:13:22 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gcZDl-0005jj-K2
 for 33847 <at> debbugs.gnu.org; Thu, 27 Dec 2018 12:13:22 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6C606160D6A;
 Thu, 27 Dec 2018 09:13:15 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 25PAGGbFJ6la; Thu, 27 Dec 2018 09:13:14 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3808F160D8E;
 Thu, 27 Dec 2018 09:13:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Bnw5cjwhI9Xj; Thu, 27 Dec 2018 09:13:14 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 159A0160A6F;
 Thu, 27 Dec 2018 09:13:14 -0800 (PST)
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
From: Paul Eggert <eggert@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
 <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
To: ulm@HIDDEN
Organization: UCLA Computer Science Department
Message-ID: <27d2f2eb-8956-4088-f3ec-5ff6c2cf2e8f@HIDDEN>
Date: Thu, 27 Dec 2018 09:13:13 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich, have you tried starting your Emacs server as a lingering service? 
Lingering seems to be designed for the sort of thing you want to do. Look for 
"enable-linger" in <https://www.freedesktop.org/software/systemd/man/loginctl.html>.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 27 Dec 2018 16:42:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 27 11:42:49 2018
Received: from localhost ([127.0.0.1]:39484 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcYkD-0004zT-CV
	for submit <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:42:49 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36910)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gcYkB-0004zH-4v
 for 33847 <at> debbugs.gnu.org; Thu, 27 Dec 2018 11:42:47 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id E9800160922;
 Thu, 27 Dec 2018 08:42:40 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id z4aIm849zNcG; Thu, 27 Dec 2018 08:42:40 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3B875160D0F;
 Thu, 27 Dec 2018 08:42:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id AgsROTnKsAWi; Thu, 27 Dec 2018 08:42:40 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 146CA16059D;
 Thu, 27 Dec 2018 08:42:40 -0800 (PST)
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
To: rms@HIDDEN
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <E1gcMVI-0003Yd-60@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <c59152d9-a120-3733-7c8c-55f3aff5dcc5@HIDDEN>
Date: Thu, 27 Dec 2018 08:42:39 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <E1gcMVI-0003Yd-60@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: ulm@HIDDEN, 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Richard Stallman wrote:
> Is it possible to arrange for each user to have a directory under /run/emacs
> which is owned by that user and doesn't give access to anyone else?
> 
> Maybe we could release a simple setuid program to create that directory.

Although I think that would work, as Ulrich wrote in Bug#33847#26 it has an 
operational problem: it requires the creation and installation of either a 
setuid program (which will raise eyebrows) or the creation of a new 'emacs' 
group and installation of a setgid 'emacs' program (which will raise fewer 
eyebrows but is still a hassle). Adding either requirement would be a hassle for 
builders and installers (e.g., how do you test the new Emacs before installing 
it if you don't have rights to create a setuid program in the build directory?). 
So we are looking for a better solution if possible.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 27 Dec 2018 03:39:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 26 22:39:27 2018
Received: from localhost ([127.0.0.1]:38105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcMW2-0003fG-Q4
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 22:39:27 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38117)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1gcMVw-0003ex-Lo
 for 33847 <at> debbugs.gnu.org; Wed, 26 Dec 2018 22:39:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rms@HIDDEN>) id 1gcMVl-0001Fd-VO
 for 33847 <at> debbugs.gnu.org; Wed, 26 Dec 2018 22:39:11 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54027)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>)
 id 1gcMVI-0008Tk-Ac; Wed, 26 Dec 2018 22:38:36 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1gcMVI-0003Yd-60; Wed, 26 Dec 2018 22:38:36 -0500
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN> (message from
 Paul Eggert on Tue, 25 Dec 2018 16:24:10 -0800)
Subject: Re: bug#33847: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
Message-Id: <E1gcMVI-0003Yd-60@HIDDEN>
Date: Wed, 26 Dec 2018 22:38:36 -0500
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: ulm@HIDDEN, 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Tools like 'screen' that predate XDG_RUNTIME_DIR traditionally suffered from 
  > similar security problems. On my Fedora 29 platform, 'screen' works around the 
  > problem by being setgid 'screen' and putting files under /run/screen/S-eggert, 
  > where /run/screen is mode drwxrwxr-x with owner 'root' and group 'screen'. The 
  > exact location of the /run/screen directory is platform-specific; I guess that 
  > it typically used to be /tmp/screens but got moved due to security concerns.

Is it possible to arrange for each user to have a directory under /run/emacs
which is owned by that user and doesn't give access to anyone else?

Maybe we could release a simple setuid program to create that directory.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 18:32:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 26 13:32:29 2018
Received: from localhost ([127.0.0.1]:37939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcDym-0006m0-W3
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 13:32:29 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53176)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gcDyk-0006lm-Dt
 for 33847 <at> debbugs.gnu.org; Wed, 26 Dec 2018 13:32:27 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id E2A47160D71;
 Wed, 26 Dec 2018 10:32:20 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id srieUTwdcnhX; Wed, 26 Dec 2018 10:32:19 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id D557B160D74;
 Wed, 26 Dec 2018 10:32:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id bYWTrJBEgPSZ; Wed, 26 Dec 2018 10:32:19 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id AC9401609D6;
 Wed, 26 Dec 2018 10:32:19 -0800 (PST)
Subject: Re: 27.0.50; emacsclient does not find server socket
To: Ulrich Mueller <ulm@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <w6gtvj13tuh.fsf@HIDDEN>
 <476852d0-9cd6-a6ae-a11d-bb4d761323da@HIDDEN>
 <w6gmuos48xl.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <cfa82784-a804-07ba-7d5a-d4ab5d05cf96@HIDDEN>
Date: Wed, 26 Dec 2018 10:32:19 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <w6gmuos48xl.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich Mueller wrote:

> server.el seems to take all necessary precautions
> to ensure that the directory is safe:

>     (server-ensure-safe-dir DIR)
>=20
>     Make sure DIR is a directory with no race-condition issues.
>     Creates the directory if necessary and makes sure:
>     - there=E2=80=99s no symlink involved
>     - it=E2=80=99s owned by us
>     - it=E2=80=99s not readable/writable by anybody else.

The problem on the server side isn't in server-ensure-safe-dir, it's that=
=20
something could happen between the time that server-ensure-safe-dir check=
s that=20
DIR is safe, and the time that DIR is actually used.

> In addition, emacsclient checks for the ownership of the socket before
> connecting to it.

Sure, but that doesn't mean it's the right socket. We discussed this last=
 month;=20
please see the thread containing:

https://lists.gnu.org/archive/html/emacs-devel/2018-11/msg00051.html

>>> No need for Emacs itself to be setgid, because the directory could
>>> be created by calling an auxiliary setgid program (similar to
>>> update-game-score).
>=20
>> That might work, as a solution for people who want Emacs to keep
>> running even when they entirely log out.
>=20
> It would also be rather complicated, and require creation of an emacs
> group.

True. I also would prefer a better solution than that.

> Emacs 26 uses ${TMPDIR}/emacs${UID}/ or ${HOME}/.emacs.d/server/
> depending on the server-use-tcp flag. Emacs 27 will use one of these
> two or ${XDG_RUNTIME_DIR} as a default (depending on the environment).
> IMHO this is approaching the point where things become unpredictable
> and hard to understand for the user. (And making it more customizable
> won't make it simpler, I fear.)

True, it has gotten more complicated. If we could simplify it without reo=
pening=20
the security holes that would be a good thing.

> can't the socket be placed
> in ${HOME}/.emacs.d/ which is already used in the TCP case? The socket
> could be named server-<system-name>, in order to avoid issues with NFS
> mounted directories.

That would cause problems when Emacs crashes or the system reboots, since=
 the=20
directory wouldn't be cleaned up automatically. So although we could add =
this as=20
an option, I'm a bit leery of making it the default.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 15:14:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 26 10:14:26 2018
Received: from localhost ([127.0.0.1]:37865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gcAt8-0008C4-IX
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 10:14:26 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:55390)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gcAt7-0008Bq-2G
 for 33847 <at> debbugs.gnu.org; Wed, 26 Dec 2018 10:14:25 -0500
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 0E704335C30;
 Wed, 26 Dec 2018 15:14:17 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <w6gtvj13tuh.fsf@HIDDEN>
 <476852d0-9cd6-a6ae-a11d-bb4d761323da@HIDDEN>
Date: Wed, 26 Dec 2018 16:14:14 +0100
In-Reply-To: <476852d0-9cd6-a6ae-a11d-bb4d761323da@HIDDEN> (Paul Eggert's
 message of "Tue, 25 Dec 2018 22:59:08 -0800")
Message-ID: <w6gmuos48xl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Wed, 26 Dec 2018, Paul Eggert wrote:

> Ulrich Mueller wrote:
>> XDG_RUNTIME_DIR is simply not suitable for the purpose, because (by its
>> specification) it will disappear when the login session ends,

> I think the idea is that XDG_RUNTIME_DIR disappears when all login
> sessions end, so it might survive the current session.

I still don't see why XDG_RUNTIME_DIR would be more secure than using
a directory in TMPDIR. server.el seems to take all necessary precautions
to ensure that the directory is safe:

   server-ensure-safe-dir is a compiled Lisp function in =E2=80=98server.el=
=E2=80=99.

   (server-ensure-safe-dir DIR)

   Make sure DIR is a directory with no race-condition issues.
   Creates the directory if necessary and makes sure:
   - there=E2=80=99s no symlink involved
   - it=E2=80=99s owned by us
   - it=E2=80=99s not readable/writable by anybody else.

In addition, emacsclient checks for the ownership of the socket before
connecting to it.

>> No need for Emacs itself to be setgid, because the directory could
>> be created by calling an auxiliary setgid program (similar to
>> update-game-score).

> That might work, as a solution for people who want Emacs to keep
> running even when they entirely log out.

It would also be rather complicated, and require creation of an emacs
group. Using a directory where the user has write access is easier.
AFAICS, the three candidates for that are TMPDIR, HOME, and
XDG_RUNTIME_DIR.

Emacs 26 uses ${TMPDIR}/emacs${UID}/ or ${HOME}/.emacs.d/server/
depending on the server-use-tcp flag. Emacs 27 will use one of these
two or ${XDG_RUNTIME_DIR} as a default (depending on the environment).
IMHO this is approaching the point where things become unpredictable
and hard to understand for the user. (And making it more customizable
won't make it simpler, I fear.)

If TMPDIR really is insecure (see above), can't the socket be placed
in ${HOME}/.emacs.d/ which is already used in the TCP case? The socket
could be named server-<system-name>, in order to avoid issues with NFS
mounted directories.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 06:59:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 26 01:59:18 2018
Received: from localhost ([127.0.0.1]:36562 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gc39y-0001qV-Di
	for submit <at> debbugs.gnu.org; Wed, 26 Dec 2018 01:59:18 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59130)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gc39w-0001qD-7c
 for 33847 <at> debbugs.gnu.org; Wed, 26 Dec 2018 01:59:17 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 32FD6160D3D;
 Tue, 25 Dec 2018 22:59:10 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id 8QAjWoOv7tou; Tue, 25 Dec 2018 22:59:09 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 53556160D3E;
 Tue, 25 Dec 2018 22:59:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id kfua2X9vR0vx; Tue, 25 Dec 2018 22:59:09 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2E6D1160D10;
 Tue, 25 Dec 2018 22:59:09 -0800 (PST)
Subject: Re: 27.0.50; emacsclient does not find server socket
To: Ulrich Mueller <ulm@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
 <w6gtvj13tuh.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <476852d0-9cd6-a6ae-a11d-bb4d761323da@HIDDEN>
Date: Tue, 25 Dec 2018 22:59:08 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <w6gtvj13tuh.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich Mueller wrote:
> IMHO, unsetting a standard variable like XDG_RUNTIME_DIR (as you've
> suggested above) in the user's session isn't really an option.

You're right, unsetting it for an entire session would mean that you want all 
programs (not just Emacs) to not use XDG_RUNTIME_DIR, and that sounds too 
drastic. I don't recall suggesting that.

> And a
> wrapper script around emacsclient would be just awkward.

It's not *that* awkward, and it may be acceptable if the situation you describe 
is unusual enough.

> Plus, as it is currently implemented, there isn't even a unique way to
> override the socket's location. I notice that emacsclient will now
> honour the EMACS_SOCKET_NAME variable, but then again, server.el doesn't
> use it.

Although I'm not a big fan of environment variables, it might make sense for 
server.el to look at EMACS_SOCKET_NAME, for consistency with emacsclient.

> So if we would want to override the socket's location at the
> distro level (e.g., place it in /run/emacs/${USER}/), how could we do
> that?

There's no mechanism in Emacs to do that now. It would be OK to add one, I expect.

> If it is a security issue, then why isn't the fix in the emacs-26 branch
> as well?

emacs-26 at this point is meant for fixing regressions, and the problem in 
question is not a regression. Anyway, this change was too risky for the emacs-26 
branch.

> Also, why is there still a fallback to TMPDIR, if that's
> considered insecure?

On a system that doesn't set XDG_RUNTIME_DIR it was the best we could easily do. 
If we can come up with something better for those systems, that would be good.

For systems with XDG_RUNTIME_DIR it would probably be better to not reinvent 
this particular wheel. That is, for users who prefer Emacs to run only when they 
are logged in, XDG_RUNTIME_DIR seems to be the way to go. For users who prefer 
Emacs to always be running, even when they are not logged in, we should use some 
other mechanism.

> XDG_RUNTIME_DIR is simply not suitable for the purpose, because (by its
> specification) it will disappear when the login session ends,

I think the idea is that XDG_RUNTIME_DIR disappears when all login sessions end, 
so it might survive the current session.

>> The 'screen' workaround does not appear to apply to Emacs, since Emacs
>> is programmable and if Emacs were made setgid its users could easily
>> modify Emacs's behavior to manipulate the contents of any such
>> /run/emacs directory in any way they pleased.
> 
> No need for Emacs itself to be setgid, because the directory could
> be created by calling an auxiliary setgid program (similar to
> update-game-score).

That might work, as a solution for people who want Emacs to keep running even 
when they entirely log out.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 02:28:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 25 21:28:03 2018
Received: from localhost ([127.0.0.1]:36537 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbyvS-0002pd-Kn
	for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 21:28:02 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:54946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gbyvQ-0002p8-Qf
 for 33847 <at> debbugs.gnu.org; Tue, 25 Dec 2018 21:28:01 -0500
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 04E95335C39;
 Wed, 26 Dec 2018 02:27:53 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
 <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
Date: Wed, 26 Dec 2018 03:27:50 +0100
In-Reply-To: <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN> (Paul Eggert's
 message of "Tue, 25 Dec 2018 16:24:10 -0800")
Message-ID: <w6gtvj13tuh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Wed, 26 Dec 2018, Paul Eggert wrote:

>> IMHO that's not an acceptable solution. emacsclient should just work in
>> the default configuration, without requiring the user to jump through
>> hoops, and an Emacs daemon should persist between sessions (otherwise
>> "daemon" would be a misnomer). Or is that use case really so uncommon?

> We have a conflict here between "just work" and security. There are
> multiple workarounds for the problem that you mention; if none of them
> are convenient enough perhaps you can suggest a more-convenient one.

IMHO, unsetting a standard variable like XDG_RUNTIME_DIR (as you've
suggested above) in the user's session isn't really an option. And a
wrapper script around emacsclient would be just awkward.

Plus, as it is currently implemented, there isn't even a unique way to
override the socket's location. I notice that emacsclient will now
honour the EMACS_SOCKET_NAME variable, but then again, server.el doesn't
use it. So if we would want to override the socket's location at the
distro level (e.g., place it in /run/emacs/${USER}/), how could we do
that? Having to add configuration to both site-start.el and to the
user's environment seems less than optimal.

> The default should be secure, though.

If it is a security issue, then why isn't the fix in the emacs-26 branch
as well? Also, why is there still a fallback to TMPDIR, if that's
considered insecure?

>> if there is a security problem, how would it disappear by moving
>> the socket to XDG_RUNTIME_DIR? Note that other tools like "screen" also
>> place their sockets in a subdir of /tmp.

> XDG_RUNTIME_DIR is guaranteed to be a directory owned by the user and
> readable and writable by nobody else. /tmp/emacsUID does not have that
> property.

XDG_RUNTIME_DIR is simply not suitable for the purpose, because (by its
specification) it will disappear when the login session ends, leading to
an Emacs daemon process that has no socket and can no longer be
connected to. Of course, unless one assumes that the daemon will not
persist the login session, but what would be the point of starting Emacs
as a daemon then?

> The 'screen' workaround does not appear to apply to Emacs, since Emacs
> is programmable and if Emacs were made setgid its users could easily
> modify Emacs's behavior to manipulate the contents of any such
> /run/emacs directory in any way they pleased.

No need for Emacs itself to be setgid, because the directory could
be created by calling an auxiliary setgid program (similar to
update-game-score).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 00:24:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 25 19:24:19 2018
Received: from localhost ([127.0.0.1]:36515 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbwzj-0007zu-3A
	for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 19:24:19 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35660)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gbwzh-0007ze-CE
 for 33847 <at> debbugs.gnu.org; Tue, 25 Dec 2018 19:24:17 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id BFF19160AD6;
 Tue, 25 Dec 2018 16:24:11 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Orn_U93Kbxx2; Tue, 25 Dec 2018 16:24:11 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 02C96160D59;
 Tue, 25 Dec 2018 16:24:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id FJgKHqGt6WVb; Tue, 25 Dec 2018 16:24:10 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D0EA0160A77;
 Tue, 25 Dec 2018 16:24:10 -0800 (PST)
Subject: Re: 27.0.50; emacsclient does not find server socket
To: Ulrich Mueller <ulm@HIDDEN>
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
 <w6gy38d423g.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@HIDDEN>
Date: Tue, 25 Dec 2018 16:24:10 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <w6gy38d423g.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ulrich Mueller wrote:
> IMHO that's not an acceptable solution. emacsclient should just work in
> the default configuration, without requiring the user to jump through
> hoops, and an Emacs daemon should persist between sessions (otherwise
> "daemon" would be a misnomer). Or is that use case really so uncommon?

We have a conflict here between "just work" and security. There are multiple 
workarounds for the problem that you mention; if none of them are convenient 
enough perhaps you can suggest a more-convenient one. The default should be 
secure, though.

> if there is a security problem, how would it disappear by moving
> the socket to XDG_RUNTIME_DIR? Note that other tools like "screen" also
> place their sockets in a subdir of /tmp.

XDG_RUNTIME_DIR is guaranteed to be a directory owned by the user and readable 
and writable by nobody else. /tmp/emacsUID does not have that property.

Tools like 'screen' that predate XDG_RUNTIME_DIR traditionally suffered from 
similar security problems. On my Fedora 29 platform, 'screen' works around the 
problem by being setgid 'screen' and putting files under /run/screen/S-eggert, 
where /run/screen is mode drwxrwxr-x with owner 'root' and group 'screen'. The 
exact location of the /run/screen directory is platform-specific; I guess that 
it typically used to be /tmp/screens but got moved due to security concerns.

The 'screen' workaround does not appear to apply to Emacs, since Emacs is 
programmable and if Emacs were made setgid its users could easily modify Emacs's 
behavior to manipulate the contents of any such /run/emacs directory in any way 
they pleased.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 25 Dec 2018 23:29:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 25 18:29:53 2018
Received: from localhost ([127.0.0.1]:36502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbw93-0006fN-3f
	for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 18:29:53 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:40604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gbw90-0006f7-7J
 for 33847 <at> debbugs.gnu.org; Tue, 25 Dec 2018 18:29:50 -0500
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 64E61335C3D;
 Tue, 25 Dec 2018 23:29:43 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: 27.0.50; emacsclient does not find server socket
References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
Date: Wed, 26 Dec 2018 00:29:39 +0100
In-Reply-To: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN> (Paul Eggert's
 message of "Tue, 25 Dec 2018 13:02:34 -0800")
Message-ID: <w6gy38d423g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

>>>>> On Tue, 25 Dec 2018, Paul Eggert wrote:

> Instead, I suggest unsetting XDG_RUNTIME_DIR if you wish to start an
> Emacs client or server that is independent of your session and are on
> a host that is secured well enough so that the security issues are of
> no concern. Alternatively, you can use --socket-name when starting
> emacsclient.

IMHO that's not an acceptable solution. emacsclient should just work in
the default configuration, without requiring the user to jump through
hoops, and an Emacs daemon should persist between sessions (otherwise
"daemon" would be a misnomer). Or is that use case really so uncommon?

Also, if there is a security problem, how would it disappear by moving
the socket to XDG_RUNTIME_DIR? Note that other tools like "screen" also
place their sockets in a subdir of /tmp.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 25 Dec 2018 21:02:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 25 16:02:44 2018
Received: from localhost ([127.0.0.1]:36466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gbtqe-0002zw-Hv
	for submit <at> debbugs.gnu.org; Tue, 25 Dec 2018 16:02:44 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1gbtqc-0002zf-DE
 for 33847 <at> debbugs.gnu.org; Tue, 25 Dec 2018 16:02:42 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7480F160D3F;
 Tue, 25 Dec 2018 13:02:35 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id tsNS_RiUwGG9; Tue, 25 Dec 2018 13:02:34 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id BC014160D43;
 Tue, 25 Dec 2018 13:02:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id jZiq0Tn8x8MM; Tue, 25 Dec 2018 13:02:34 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 95B90160922;
 Tue, 25 Dec 2018 13:02:34 -0800 (PST)
To: Ulrich Mueller <ulm@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Subject: 27.0.50; emacsclient does not find server socket
Organization: UCLA Computer Science Department
Message-ID: <8a6fc59c-08b3-e274-4fb1-74674c79540a@HIDDEN>
Date: Tue, 25 Dec 2018 13:02:34 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 33847
Cc: 33847 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Suggested solutions:
> - Create the socket in a dir that is more readily available, for example 
>   somewhere under ${HOME}/emacs.d/

Unfortunately that won't work well in general, as $HOME/emacs.d might not exist, 
or it might be on a network file system where a host-specific file would be 
inappropriate.

> - Have emacsclient fall back to TMPDIR as well when no socket is found
>   under XDG_RUNTIME_DIR

This would run afoul of the security issues that led to the use of 
XDG_RUNTIME_DIR in the first place.

Instead, I suggest unsetting XDG_RUNTIME_DIR if you wish to start an Emacs 
client or server that is independent of your session and are on a host that is 
secured well enough so that the security issues are of no concern. 
Alternatively, you can use --socket-name when starting emacsclient.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at 33847 <at> debbugs.gnu.org:


Received: (at 33847) by debbugs.gnu.org; 23 Dec 2018 16:20:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 23 11:20:26 2018
Received: from localhost ([127.0.0.1]:33930 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gb6UM-0004h7-M6
	for submit <at> debbugs.gnu.org; Sun, 23 Dec 2018 11:20:26 -0500
Received: from smtp.gentoo.org ([140.211.166.183]:57712)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gb6UL-0004gs-3u
 for 33847 <at> debbugs.gnu.org; Sun, 23 Dec 2018 11:20:25 -0500
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 17FEE335C36;
 Sun, 23 Dec 2018 16:20:17 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: 33847 <at> debbugs.gnu.org
Subject: Re: 27.0.50; emacsclient does not find server socket
References: <w6gh8f460bj.fsf@HIDDEN>
Date: Sun, 23 Dec 2018 17:20:10 +0100
In-Reply-To: <w6gh8f460bj.fsf@HIDDEN> (Ulrich Mueller's message of
 "Sun, 23 Dec 2018 10:48:16 +0100")
Message-ID: <w6ga7kw5i6d.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 33847
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

The specification of XDG_RUNTIME_DIR at
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables
says this:

| $XDG_RUNTIME_DIR defines the base directory relative to which
| user-specific non-essential runtime files and other file objects
| (such as sockets, named pipes, ...) should be stored. [...]

| The lifetime of the directory MUST be bound to the user being logged
| in. It MUST be created when the user first logs in and if the user
| fully logs out the directory MUST be removed. [...]
| Files in the directory MUST not survive reboot or a full
| logout/login cycle.

It explicitly says that the directory does not persist between login
sessions, whereas - at least in my understanding - an Emacs running as
a daemon is supposed to survive logout, so that the user can reconnect
to it later. (For example, I use that feature for persistent ERC
sessions.)

So, I would conclude that XDG_RUNTIME_DIR is not an appropriate
location for the socket of a daemon process.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Dec 2018 09:48:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 23 04:48:37 2018
Received: from localhost ([127.0.0.1]:60548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gb0NB-00014i-49
	for submit <at> debbugs.gnu.org; Sun, 23 Dec 2018 04:48:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54316)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ulm@HIDDEN>) id 1gb0N8-00014U-An
 for submit <at> debbugs.gnu.org; Sun, 23 Dec 2018 04:48:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ulm@HIDDEN>) id 1gb0N2-0002pY-EP
 for submit <at> debbugs.gnu.org; Sun, 23 Dec 2018 04:48:29 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:36229)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <ulm@HIDDEN>) id 1gb0N2-0002pS-BQ
 for submit <at> debbugs.gnu.org; Sun, 23 Dec 2018 04:48:28 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54314)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ulm@HIDDEN>) id 1gb0N1-0002Ui-KD
 for bug-gnu-emacs@HIDDEN; Sun, 23 Dec 2018 04:48:28 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ulm@HIDDEN>) id 1gb0My-0002ni-Dy
 for bug-gnu-emacs@HIDDEN; Sun, 23 Dec 2018 04:48:27 -0500
Received: from dev.gentoo.org ([2001:470:ea4a:1:5054:ff:fec7:86e4]:44149
 helo=smtp.gentoo.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <ulm@HIDDEN>) id 1gb0My-0002f4-8A
 for bug-gnu-emacs@HIDDEN; Sun, 23 Dec 2018 04:48:24 -0500
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 F390F335C6F;
 Sun, 23 Dec 2018 09:48:19 +0000 (UTC)
From: Ulrich Mueller <ulm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; emacsclient does not find server socket
Date: Sun, 23 Dec 2018 10:48:16 +0100
Message-ID: <w6gh8f460bj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.3 (-----)

The master branch was recently updated to place the server socket in
XDG_RUNTIME_DIR, with a fallback to the previous TMPDIR location.
This will make emacsclient fail when the server has been started from
an environment where XDG_RUNTIME_DIR is not set.

For example, if emacs --daemon is started on a Gentoo system via
OpenRC's start-stop-daemon, then emacs will create the socket in
${TMPDIR}/emacs${UID}/, but emacsclient (in the user's X session)
will search for it in ${XDG_RUNTIME_DIR}/emacs/:

$ emacsclient -c
emacsclient: can't find socket; have you started the server?
emacsclient: To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor.  Please use:

        --socket-name
        --server-file      (or environment variable EMACS_SERVER_FILE)
        --alternate-editor (or environment variable ALTERNATE_EDITOR)

(The reason is of course that start-stop-daemon does not set the XDG_*
variables. However, I don't see how it could do that in any reasonable
way. Presumably it would have to happen via PAM and ConsoleKit, but the
latter doesn't have a display at that point.)

Suggested solutions:
- Create the socket in a dir that is more readily available, for example 
  somewhere under ${HOME}/emacs.d/, or
- Have emacsclient fall back to TMPDIR as well when no socket is found
  under XDG_RUNTIME_DIR.




Acknowledgement sent to Ulrich Mueller <ulm@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#33847; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 30 Dec 2018 06:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.