From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pedro Andres Aranda Gutierrez Newsgroups: gmane.emacs.devel Subject: Re: emacsclient startup messages Date: Sun, 31 Oct 2021 11:03:02 +0100 Message-ID: References: <89dc096b-6c33-db5a-d2d2-b43fb92e4900@gmail.com> <074495a9-aff8-edce-f81f-51fdfc622f6e@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000007c8e805cfa32c4a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15355"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ulrich Mueller , emacs-devel To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 31 11:04:41 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mh7hh-0003nJ-Hk for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Oct 2021 11:04:41 +0100 Original-Received: from localhost ([::1]:39880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mh7hf-0004no-Fg for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Oct 2021 06:04:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mh7ge-0003NH-QC for emacs-devel@gnu.org; Sun, 31 Oct 2021 06:03:36 -0400 Original-Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:37765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mh7gc-0005pb-KZ for emacs-devel@gnu.org; Sun, 31 Oct 2021 06:03:36 -0400 Original-Received: by mail-lj1-x234.google.com with SMTP id 188so24546777ljj.4 for ; Sun, 31 Oct 2021 03:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KCkOAsZn2jpwUyGzrFZ4Alx/BLutv+KsGCs9T20M+8o=; b=IYBQfMYWoj8QGND4x2z0OMXT5j1UaGlc31LQ/groY3JtXKx67zH68Q05aa+DlwTAJ5 0LQl/7qzA2duRsIhv0QRZ+Z21MN9rE0ioiW7eVXqZEsvHaCH3l5EYVCuKUcVgiI6ZZ4n 5fFUwf7IN9QcekqSgEgjRvfb/2g9WSrzNFNKVuZ2i0XTvqLKHbVJ3iM1Xgh0ClDLl7Vq DzHpDwXzYOQBu4QgTkqKZf27/CMBCislSyaFtwXakeUCdH3WiPGHY7KMcd9Y3XPWJnOr KfJd3kWwDpLRUqUY5+FyXb2XQWLKRkEp7qi3TMTnfoTUYJ56SY9BEmZgPAVAO1bW+9HL vlmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KCkOAsZn2jpwUyGzrFZ4Alx/BLutv+KsGCs9T20M+8o=; b=6kJH9PHc0YSM+y5HIQK3HPcAZ4RPFq2YIpvha2xetMxjM9bhG5u8Jrk1v6R7B59kiV ATW0q3odGhnhgYiEt3rVC8EbnMfD/tRPchLv/+dm9nxqAu/W1GBwC8Uw3w5/GqMUX9e9 IdKbr2dgjAIU0NfOob1xV0cRutH8+ZpD48/0E6zEYKbrgp2VOBZ8in26JEdvZgU7Z7ye KiwaLKvWEAVkkJ4YpN2tRISsaWFEL5mCOXv4H3eMBXVMoAPzAdBdozARhRqfgevvUUUf mnQ6WqQcmNPtYGPt7MnzPJxRAwlMwetbIYT+op49urxKluIQ7b29WyHPpdOWCFohqOFG qQWQ== X-Gm-Message-State: AOAM533hn/368pExk7jcSgVDWWGH733e7tYvnkoc1eCsNTCiHJJx89BV H4KqyQQ6jFx5smcqMFtEV5lL8yPlpDDDWegSn48= X-Google-Smtp-Source: ABdhPJwb3FSMI8fB6nKh0xdTiFYLsB8maQGMnU77rFkAAMGZ7NikWU30Eaq/ywK3DmH1fEtr6OuIEWpYjS4+3ywtsEk= X-Received: by 2002:a05:651c:169c:: with SMTP id bd28mr23798716ljb.289.1635674608878; Sun, 31 Oct 2021 03:03:28 -0700 (PDT) In-Reply-To: <074495a9-aff8-edce-f81f-51fdfc622f6e@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=paaguti@gmail.com; helo=mail-lj1-x234.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, HTML_MESSAGE=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: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278304 Archived-At: --00000000000007c8e805cfa32c4a Content-Type: text/plain; charset="UTF-8" HI Jim, I've patched my emacs-28 source and am compiling the whole beat right now. Once installed, I'll let you know :-) /PA On Sat, 30 Oct 2021 at 21:47, Jim Porter wrote: > On 10/30/2021 12:16 PM, Jim Porter wrote: > > On 10/30/2021 10:39 AM, Ulrich Mueller wrote: > >> There can be situations where there is an XDG environment for the client > >> but not for the daemon. > > > > Right, the patch in bug#33847 should handle that case correctly, but I'm > > pretty sure the current implementation opens users who spawn the Emacs > > daemon on-demand to symlink attacks. That's due to the code needing to > > check both XDG_RUNTIME_DIR and TMPDIR before being sure there's no > > daemon to connect to. > > > > I can think of two ways to avoid this issue: > [snip] > > 2) If XDG_RUNTIME_DIR and ALTERNATE_EDITOR/--alternate-editor are both > > set, never check TMPDIR. This should let both cases work without > > requiring users to explicitly set a flag anywhere, but it the lack of > > explicitness could be more confusing. I think this should work fine in > > all cases, since users running `emacs --daemon' without XDG probably > > won't be using ALTERNATE_EDITOR (the daemon should always be running, so > > there's no need for an alternate editor). > > I posted a patch for method (2) to bug#51327 here: > . > -- Fragen sind nicht da um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler --00000000000007c8e805cfa32c4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
HI Jim,
I've patched my emacs-28 source= and am compiling the whole beat right now.
Once installed, I'= ;ll let you know :-)
/PA

On Sat, 30 Oct 2021 at 21:47, J= im Porter <jporterbugs@gmail.co= m> wrote:
On 10/30/2021 12:16 PM, Jim Porter wrote:
> On 10/30/2021 10:39 AM, Ulrich Mueller wrote:
>> There can be situations where there is an XDG environment for the = client
>> but not for the daemon.
>
> Right, the patch in bug#33847 should handle that case correctly, but I= 'm
> pretty sure the current implementation opens users who spawn the Emacs=
> daemon on-demand to symlink attacks. That's due to the code needin= g to
> check both XDG_RUNTIME_DIR and TMPDIR before being sure there's no=
> daemon to connect to.
>
> I can think of two ways to avoid this issue:
[snip]
> 2) If XDG_RUNTIME_DIR and ALTERNATE_EDITOR/--alternate-editor are both=
> set, never check TMPDIR. This should let both cases work without
> requiring users to explicitly set a flag anywhere, but it the lack of =
> explicitness could be more confusing. I think this should work fine in=
> all cases, since users running `emacs --daemon' without XDG probab= ly
> won't be using ALTERNATE_EDITOR (the daemon should always be runni= ng, so
> there's no need for an alternate editor).

I posted a patch for method (2) to bug#51327 here:
<https://lists.gnu.org/arch= ive/html/bug-gnu-emacs/2021-10/msg02638.html>.


--
Fragen sin= d nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu= werden
Georg Kreisler
--00000000000007c8e805cfa32c4a--