From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#51327: 28.0.60; emacsclient warns about XDG_RUNTIME_DIR when starting daemon on-demand Date: Thu, 21 Oct 2021 21:58:00 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20045"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eggert@cs.ucla.edu To: 51327@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 22 06:59:10 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 1mdme6-00056I-2C for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Oct 2021 06:59:10 +0200 Original-Received: from localhost ([::1]:46592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdme4-00024V-5d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Oct 2021 00:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdmdy-00024M-VU for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 00:59:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdmdy-0006cZ-NJ for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 00:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdmdy-00012c-N6 for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 00:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Oct 2021 04:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51327 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16348786893909 (code B ref -1); Fri, 22 Oct 2021 04:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Oct 2021 04:58:09 +0000 Original-Received: from localhost ([127.0.0.1]:59069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdmd7-00010z-GJ for submit@debbugs.gnu.org; Fri, 22 Oct 2021 00:58:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdmd5-00010q-T8 for submit@debbugs.gnu.org; Fri, 22 Oct 2021 00:58:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdmd5-00021Y-IV for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 00:58:07 -0400 Original-Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:36439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdmd1-0006HU-Qw for bug-gnu-emacs@gnu.org; Fri, 22 Oct 2021 00:58:07 -0400 Original-Received: by mail-pg1-x533.google.com with SMTP id 75so2277304pga.3 for ; Thu, 21 Oct 2021 21:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:cc:message-id:date:mime-version:content-language :content-transfer-encoding; bh=hvJGcbhYZLpEGRxE6NByVUbEDo7XK61DwYuIxjCJy5M=; b=QXHXVljBdGS0Aj9c1zINGDhLCuR9wmHyPIcxnvPabRDMJ+NlhK5lSQc+X2NcouQhvo hGKV9UDEWut4FaOYkXaL12uf1ZjC1Gjt+jEEcmHH1qZRlkeLUeGG6IFr6JaWQe3Lxryz +X633v+61QatKbSc0FebIfKPXVg0wjIHsA5Vphx8gfbPBMC7BParf6HsE20esVg2HBoQ p1u4xBQBinGh0SNHdHFtI3JwpRCHDM1EMMOBRYh2XsMYJlZ65CeUkHjeq2TKONe/Gmgi JpKtDR6h8B9YmV1DoUHgouW2AJudGw9EYUdDMzuRRQTGC/DQqfgz/aKuMqzVDdH0Irmh rhgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:message-id:date:mime-version :content-language:content-transfer-encoding; bh=hvJGcbhYZLpEGRxE6NByVUbEDo7XK61DwYuIxjCJy5M=; b=hPLapf1XK9UKlFrJA/miIrzLCcPdkhBe9v0WgVj05heI/nXI+3fs0UzdcSFW46OYiP H4SA7mXu3wqvR3NBYPTWXYZDfy5pTpkdvQef/qHoxX6/TEuQvdqpDuRlH7vCiG8OZuOz q0czJt08C1b/+aUBQaSTkfmabzea7jmCuryzgX8ZNzOybr/BCgDG28ofbQ2HbXrqWXuo t5Y/Mxk5qyz1DWyTa19YG2aofkwv0LB/b6hxVlCZ3JMEolxRp0YA8nCi1q20ddyUIm3B RytlRDguMCkfwU91giVMT75VRlVwlJ/PHkHy6nF7XDUB5TWWH1ivaqSeMES4d4yx52C+ l7JQ== X-Gm-Message-State: AOAM533rT7L8rF6RCKxzxpZqA3otCrDQkbzAOW7b0Gtz78+mikWltOTH drQSUMDqrVLbvbDjDvFI7QE= X-Google-Smtp-Source: ABdhPJwFHPRO7Ldwvsfx6sjBwSXCz3ZDn+X01wCmKHMfa3uUqRmdaUa12cQz6uWuPyd9iuCsFEOVsw== X-Received: by 2002:a63:b218:: with SMTP id x24mr7630645pge.29.1634878681443; Thu, 21 Oct 2021 21:58:01 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id u11sm8165835pfg.2.2021.10.21.21.58.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 21:58:00 -0700 (PDT) X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:217843 Archived-At: Normally, when running `emacsclient --alternate-editor=""' with no Emacs server running, it will run `emacs --daemon' and then connect to it. In Emacs 28, it will also issue the following warning: Should XDG_RUNTIME_DIR='/run/user/1000' be in the environment? (Be careful: XDG_RUNTIME_DIR is security-related.) However, XDG_RUNTIME_DIR *is* set in my environment, so it shouldn't be warning me about it. I believe this is due to the fix for bug#33847 (see commit 007744dd0404d6febca88b00c22981cc630fb8c0). That bug asked for emacsclient to look in both XDG_RUNTIME_DIR and TMPDIR to find the server socket, in order to accommodate the case where `emacs --daemon' is started when XDG_RUNTIME_DIR is unset, but *is* set when running `emacsclient'. That works for the issue described in bug#33847, but for users with XDG_RUNTIME_DIR set who want `emacs --daemon' to start on demand, the change means that emacsclient will look in TMPDIR to find a server socket, record that attempt, and then warn about it before finally going ahead and starting `emacs --daemon'. I'm not an expert on XDG_RUNTIME_DIR, but my understanding is that this was added to improve security over using TMPDIR. However, as far as I can tell, the fix in bug#33847 partially undoes the security improvement for users who want to start `emacs --daemon' on demand. I'm not sure what the fix here is, at least not while ensuring that both this case and the case in bug#33847 "just work" without setting some option... (The original bug#33847 is rather long, and I see that similar concerns were raised there, so I hope I've summarized this accurately and I'm not just misunderstanding what this code is doing.)