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: Wed, 26 Dec 2018 10:32:19 -0800 Organization: UCLA Computer Science Department Message-ID: References: <8a6fc59c-08b3-e274-4fb1-74674c79540a@cs.ucla.edu> <9ebcad22-2cdb-46fb-4be9-efc4ad234b6d@cs.ucla.edu> <476852d0-9cd6-a6ae-a11d-bb4d761323da@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: quoted-printable X-Trace: blaine.gmane.org 1545849070 2483 195.159.176.226 (26 Dec 2018 18:31:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Dec 2018 18:31: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 19:31: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 1gcDxP-0000WC-KX for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 19:31:03 +0100 Original-Received: from localhost ([127.0.0.1]:47815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcDzV-0005kK-Tp for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Dec 2018 13:33:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcDzP-0005kD-RB for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 13:33:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcDzM-0004gy-5Z for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 13:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcDzK-0004g1-Id for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 13:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcDzK-0006mr-Dt for bug-gnu-emacs@gnu.org; Wed, 26 Dec 2018 13:33:02 -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 18:33:02 +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.154584914926044 (code B ref 33847); Wed, 26 Dec 2018 18:33:02 +0000 Original-Received: (at 33847) by debbugs.gnu.org; 26 Dec 2018 18:32:29 +0000 Original-Received: from localhost ([127.0.0.1]:37939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcDym-0006m0-W3 for submit@debbugs.gnu.org; Wed, 26 Dec 2018 13:32:29 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:53176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcDyk-0006lm-Dt for 33847@debbugs.gnu.org; Wed, 26 Dec 2018 13:32:27 -0500 Original-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) 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 srieUTwdcnhX; Wed, 26 Dec 2018 10:32:19 -0800 (PST) Original-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 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 bYWTrJBEgPSZ; Wed, 26 Dec 2018 10:32:19 -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 AC9401609D6; Wed, 26 Dec 2018 10:32:19 -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:153870 Archived-At: 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-, 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.