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: Fri, 5 Nov 2021 08:04:28 +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="00000000000097a46105d005420f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="686"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jim Porter , Ulrich Mueller , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 08:06:08 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 1mitIe-000AVc-02 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 08:06:08 +0100 Original-Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mitIb-0006IG-W2 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 03:06:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mitHX-0005dD-HN for emacs-devel@gnu.org; Fri, 05 Nov 2021 03:04:59 -0400 Original-Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:36723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mitHV-0000TD-5D; Fri, 05 Nov 2021 03:04:59 -0400 Original-Received: by mail-lj1-x235.google.com with SMTP id k24so13503659ljg.3; Fri, 05 Nov 2021 00:04:55 -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=zSNNwyxaSMRCRTY3pWcj8/3go2IhbQXOszUBZ4pMCY0=; b=LyPZtXQ6MYc2985XjnRrBSdq6GE3oytlmuh2tG2EAFQISnSbGylZdHVnQOmYySe9I4 DlerEE707oKp9avoEIrXZNCjsz0qEhSUWwV7fxm+gCeNA3tKO1FYfCc87G4SRKYja9Uo Miah7OLLWA2NiyYDNXsy1W6HpTOF1IMA7xO5d+fzs1yg9MMOpRvwihp+s/I1Ud6cLyNy VPR0BItnQgMa0kPtLlQ10HXOs6lMBs8BgRupC4s04O8buHswyOUlQ9EaQQxH3UyCk1n3 8yFjLptWwr220TAOWe3HdlSvW04lFWIyct4Xx+g9mIqezgGTZmjiIm7bSHIBoNQcseWE OQZA== 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=zSNNwyxaSMRCRTY3pWcj8/3go2IhbQXOszUBZ4pMCY0=; b=Ejl3XjIQXkBO+pBRvWxrjNGmbp4wxGSwLEs/LYnRZ3N0uq+kzQcpisOYyP0ZC0r5v/ NmxTg0RA5KTWoNlxuctUniO7uzbPaRBl+d8GldfyhHnn5ioLiV6kYOUvoZcEnV6oZAU5 cU/xHVCyWQZCn2PPOfAoSHGK1S0k+Dq14o3fzNWHuePfRPWkAjK2X8gPlOSAy7n87r6g 1V8ssbyTSH5G3b9M/+Q4OyauSaMdg1IO7AXqtExBuzd4vhPlGh1AjwBDBL6ON/mCAmmx Q1gHikmoUYIIKFggb/G0BKV/u2aqebyCML2h8X6nYtai3e/kM4AIX/ohNIlfkp8+nwcX P5Nw== X-Gm-Message-State: AOAM532OmypCRt4WJQ/wkNDHWUN4R9Pi3CY3R47c7aozxCdNYIiBL6uR nT8rNeXeaJFIko3mtKabvFG3yctU54vuJEvBDLID+wWnMCI= X-Google-Smtp-Source: ABdhPJzrvrQbRy1/W09LSZGTS59/x6oIP6sHtW+mIexub0PPU2BeeSUooXdcpgzPTdrc4RWxst/9WRD8qbqR80tdOuI= X-Received: by 2002:a2e:a791:: with SMTP id c17mr32022834ljf.304.1636095894200; Fri, 05 Nov 2021 00:04:54 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=paaguti@gmail.com; helo=mail-lj1-x235.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.29 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:278742 Archived-At: --00000000000097a46105d005420f Content-Type: text/plain; charset="UTF-8" Hi Eli, I have been applying the patch to my Ubuntu 20.04 builds for a couple of days and everything as worked well. Wouldn't it be a good time to put it into emacs-28? Just asking, /PA On Sun, 31 Oct 2021 at 16:44, Pedro Andres Aranda Gutierrez < paaguti@gmail.com> wrote: > Hi again, > it took a bit longer, but here we are... The patch does what I was > dreaming of (i.e. getting rid of the xdg message when calling emacsclient > with -a or when $ALTERNATE_EDITOR is set. > > Thanks! > /PA > > On Sun, 31 Oct 2021 at 11:03, Pedro Andres Aranda Gutierrez < > paaguti@gmail.com> wrote: > >> 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 >> > > > -- > Fragen sind nicht da um beantwortet zu werden, > Fragen sind da um gestellt zu werden > Georg Kreisler > -- Fragen sind nicht da um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler --00000000000097a46105d005420f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,

I have been applying the = patch to my Ubuntu 20.04 builds for a couple of days and everything as work= ed well. Wouldn't it be a good time to put it into emacs-28?

Just asking, /PA

On Sun, 31 Oct 2021 at 16:44, Pedro Andres A= randa Gutierrez <paaguti@gmail.com<= /a>> wrote:
<= div dir=3D"ltr">
Hi again,
it took a bit longer, but here we = are... The patch does what I was dreaming of (i.e. getting rid of the xdg m= essage when calling emacsclient with -a or when $ALTERNATE_EDITOR is set.

Thanks!
/PA

HI Jim,
I've patched my emacs-28 source and am compiling the whole beat r= ight now.
Once installed, I'll let you know :-)
/PA=

On Sat, 30 Oct 2021 at 21:47, Jim Porter <jporterbugs@gmail.com> wrote:=
On 10/30/2021 1= 2: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 sind nicht da um beantworte= t zu werden,
Fragen sind da um gestellt zu werden
Georg K= reisler


--
Fragen sind nicht da um beantworte= t zu werden,
Fragen sind da um gestellt zu werden
Georg K= reisler


--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um = gestellt zu werden
Georg Kreisler
--00000000000097a46105d005420f--