From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#51327: 28.0.60; emacsclient warns about XDG_RUNTIME_DIR when starting daemon on-demand Date: Wed, 8 Dec 2021 15:44:39 -0800 Organization: UCLA Computer Science Department Message-ID: <21fa6f0f-bd1b-45da-c1d4-f5d44e3b2ffe@cs.ucla.edu> References: <53706fa9-1458-fb5c-bd31-15ab555b59e9@gmail.com> <834k7kze0z.fsf@gnu.org> <212e4974-785a-65e0-70cc-fed7ea3ddacf@cs.ucla.edu> <3107b151-c56b-7c8d-7277-cbc39273a401@gmail.com> <835yryx5yf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------KlEggcpcLqppEsVCcwh7309Q" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37299"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cc: jporterbugs@gmail.com, 51327@debbugs.gnu.org To: Ulrich Mueller , Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 09 00:45:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mv6cd-0009Ux-Ua for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Dec 2021 00:45:16 +0100 Original-Received: from localhost ([::1]:36750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv6cc-0001pa-RI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Dec 2021 18:45:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv6cQ-0001pQ-Pp for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 18:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv6cQ-0001tC-HM for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 18:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mv6cQ-0006na-7e for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2021 18:45: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, 08 Dec 2021 23:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51327 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security patch Original-Received: via spool by 51327-submit@debbugs.gnu.org id=B51327.163900709126103 (code B ref 51327); Wed, 08 Dec 2021 23:45:02 +0000 Original-Received: (at 51327) by debbugs.gnu.org; 8 Dec 2021 23:44:51 +0000 Original-Received: from localhost ([127.0.0.1]:41880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv6cE-0006mw-Th for submit@debbugs.gnu.org; Wed, 08 Dec 2021 18:44:51 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv6cB-0006mf-3I for 51327@debbugs.gnu.org; Wed, 08 Dec 2021 18:44:49 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 61D711600AE; Wed, 8 Dec 2021 15:44:41 -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 X3LzJjw8613v; Wed, 8 Dec 2021 15:44:40 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7DE721600F6; Wed, 8 Dec 2021 15:44:40 -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 Zf8AlnizFUZw; Wed, 8 Dec 2021 15:44:40 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4642D1600AE; Wed, 8 Dec 2021 15:44:40 -0800 (PST) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221962 Archived-At: This is a multi-part message in MIME format. --------------KlEggcpcLqppEsVCcwh7309Q Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/8/21 13:56, Ulrich Mueller wrote: > So, can we please think about a better solution, and not knee-jerk > something half-baked into Emacs 28, like checking for yet another > environment variable? Agreed, now is not the time for significant innovation. It could be that any significant improvement will have to wait for Emacs 29. > Even reverting to the Emacs 27 behaviour would be better than what has > been suggested above: In Emacs 27, you can set EMACS_SOCKET_NAME to make > things work. Setting EMACS_SOCKET_NAME to an absolute file name should work just as well in emacs-28 as it did in Emacs 27, because in that case the code doesn't consult either XDG_RUNTIME_DIR or TMPDIR. So if that's an adequate solution, we should be able to continue with that. > Given the goal to release Emacs 28.1 soon, I'm not sure there's time to come up with (and be confident in) a better solution for 28. In that case, I guess the available options are: > > * If the security issue is considered minor enough, keep the current Emacs 28 behavior and silence the warning. I'd rather not silence the warning as there is a real issue here (admittedly obscure...). > * Otherwise, revert to the Emacs 27 behavior and come up with a better solution for Emacs 29. That sounds better, if the EMACS_SOCKET_NAME approach is good enough. Proposed patch attached. This patch attempts to be reasonably minimal vs what's in emacs-28 now (as opposed to cleaning up this somewhat-messy area). --------------KlEggcpcLqppEsVCcwh7309Q Content-Type: text/x-patch; charset=UTF-8; name="0001-emacsclient-takes-more-care-about-XDG_RUNTIME_DIR.patch" Content-Disposition: attachment; filename*0="0001-emacsclient-takes-more-care-about-XDG_RUNTIME_DIR.patch" Content-Transfer-Encoding: base64 RnJvbSAyY2I2MDg3ZjJiNzk3ZDRlYzIxZDI3YmM1MzE5OThlMDc4NDg3OTdmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBXZWQsIDggRGVjIDIwMjEgMTU6Mzc6MzkgLTA4MDAKU3ViamVjdDogW1BBVENI XSBlbWFjc2NsaWVudCB0YWtlcyBtb3JlIGNhcmUgYWJvdXQgWERHX1JVTlRJTUVfRElSCgoq IGxpYi1zcmMvZW1hY3NjbGllbnQuYyAoc2V0X2xvY2FsX3NvY2tldCk6IFJldmVydCB0byB0 aGUgRW1hY3MgMjcKYmVoYXZpb3Igb2Ygbm90IHRyeWluZyBUTVBESVIgaWYgWERHX1JVTlRJ TUVfRElSIGlzIHNldC4KVGhpcyBpcyBvbmUgb2YgdGhlIHN1Z2dlc3Rpb25zIG1hZGUgYnkg SmltIFBvcnRlciBhbmQKaW5kZXBlbmRlbnRseS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