From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#33847: 27.0.50; emacsclient does not find server socket Date: Tue, 25 Dec 2018 22:59:08 -0800 Organization: UCLA Computer Science Department Message-ID: <476852d0-9cd6-a6ae-a11d-bb4d761323da@cs.ucla.edu> References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@cs.ucla.edu> <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1545807490 11317 195.159.176.226 (26 Dec 2018 06:58:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Dec 2018 06:58:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cc: 33847@debbugs.gnu.org To: Ulrich Mueller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 26 07:58:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gc38j-0002mN-JH for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 07:58:01 +0100 Original-Received: from localhost ([127.0.0.1]:44678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gc3Aq-0006sr-EY for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 02:00:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gc3Ak-0006sk-Qa for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 02:00:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gc3Ah-0004MR-KC for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 02:00:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gc3Ah-0004Lx-Gf for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 02:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gc3Ah-0001s6-9f for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 02:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Dec 2018 07:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33847 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33847-submit@debbugs.gnu.org id=B33847.15458075587103 (code B ref 33847); Wed, 26 Dec 2018 07:00:03 +0000 Original-Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 06:59:18 +0000 Original-Received: from localhost ([127.0.0.1]:36562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gc39y-0001qV-Di for submit@debbugs.gnu.org; Wed, 26 Dec 2018 01:59:18 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gc39w-0001qD-7c for 33847@debbugs.gnu.org; Wed, 26 Dec 2018 01:59:17 -0500 Original-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) Original-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) Original-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 Original-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) Original-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) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153861 Archived-At: 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.