GNU bug report logs - #66667
[PATCH] Socket forwarding in emacsclient --tramp-prefix example

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: p.d.oliver@HIDDEN; Keywords: patch; dated Sat, 21 Oct 2023 15:03:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug No longer marked as fixed in versions 29.2 and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.
bug unarchived. Request was from Peter Oliver <p.d.oliver@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug No longer marked as fixed in versions 29.2 and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 66667-done <at> debbugs.gnu.org:


Received: (at 66667-done) by debbugs.gnu.org; 10 Jan 2024 10:15:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 05:15:03 2024
Received: from localhost ([127.0.0.1]:41919 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rNVbz-0004Ut-Ho
	for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 05:15:03 -0500
Received: from mout.gmx.net ([212.227.15.19]:35707)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1rNVbw-0004OM-RW
 for 66667-done <at> debbugs.gnu.org; Wed, 10 Jan 2024 05:15:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417;
 t=1704881687; x=1705486487; i=michael.albinus@HIDDEN;
 bh=YpgEXIrsYqCU4rakHQZg6eMwFsVA7MvqKo19gyHH3zQ=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:
 Date;
 b=qovkiMiixNPEItHk5h//MdJQs90ILEAeSa/p2y8tWhIsyYfTcliH0a27pqi/tX16
 TkqnJ/u/ag9LSyp+Nb69exZqOo1Qi0dh5jKum16yXagJUOf9mgGhHEQ3NvTosxZQc
 iaBh4ZIDXWzgzRmmy2a891+V7ebu7Rsr2cw8ZVBV/B6Y3o5nT1RHMm+ey6oRMhFkp
 tbp5UdvTEEGIuqv8WxznhIbXXpQ0mvwAl16foRg6zdmK93T9kI/iLyqHn64TwHwMD
 iVtd0iPpNb44stJz28pEWlRq2ZPmT+SLiDjIbyV8avk/70Uk7qDSMScIabf+9Zbvl
 elyc5/uO4fA/UnVmEQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from gandalf.gmx.de ([185.89.39.3]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTAFh-1rkDQv3XKh-00UY4S; Wed, 10
 Jan 2024 11:14:46 +0100
From: Michael Albinus <michael.albinus@HIDDEN>
To: Peter Oliver <p.d.oliver@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient
 --tramp-prefix example
In-Reply-To: <49e94e2b-874a-c0c8-0c4f-feb1a5ba8c34@HIDDEN> (Peter
 Oliver's message of "Sun, 22 Oct 2023 17:53:46 +0100 (BST)")
References: <20231021150127.66683-1-git@HIDDEN> <87v8azsyjs.fsf@HIDDEN>
 <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN>
 <87pm17rtk7.fsf@HIDDEN> <83r0lnovn3.fsf@HIDDEN>
 <49e94e2b-874a-c0c8-0c4f-feb1a5ba8c34@HIDDEN>
Date: Wed, 10 Jan 2024 11:14:46 +0100
Message-ID: <87ttnl8pgp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:D9lmE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ffhuA/mpF/ryHlHdtDQ008a0WOLFn2XvLSj5bOE1n
 GXK13D9hTdZM2U4cwvBIjkBx2ObKCzAP9xvzVspv3efhmC1l3JwlmaWWvKslFNemIKg0cYOza
 VQplHEgD3mOcDuVAdbuWWZRvuSgBenM0QSDMvr65SiA5FElvcjlBW0Tl0z9V+IFo9b7X6hBWS
 2DUa8A==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 66667-done
Cc: 66667-done <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Version: 29.2

Peter Oliver <p.d.oliver@HIDDEN> writes:

> I see from lib-src/emacsclient.c that they=E2=80=99re used only if
> SOCKETS_IN_FILE_SYSTEM is defined, which is only the case if WINDOWSNT
> is not defined.  I=E2=80=99ll update the wording not to imply that they d=
on=E2=80=99t
> exist, only that we don=E2=80=99t use them.

Documentation was adapted in the emacs-29 branch, so I'm closing the
bug.

Best regards, Michael.




Notification sent to p.d.oliver@HIDDEN:
bug acknowledged by developer. Full text available.
Reply sent to Michael Albinus <michael.albinus@HIDDEN>:
You have taken responsibility. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 22 Oct 2023 17:09:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 22 13:09:46 2023
Received: from localhost ([127.0.0.1]:48005 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qubxS-00029c-K2
	for submit <at> debbugs.gnu.org; Sun, 22 Oct 2023 13:09:46 -0400
Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:45356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.d.oliver@HIDDEN>) id 1qubxP-00029G-21
 for 66667 <at> debbugs.gnu.org; Sun, 22 Oct 2023 13:09:44 -0400
Received: by mail-wm1-x32c.google.com with SMTP id
 5b1f17b1804b1-4083dbc43cfso18436775e9.3
 for <66667 <at> debbugs.gnu.org>; Sun, 22 Oct 2023 10:09:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mavit.org.uk; s=google; t=1697994548; x=1698599348; darn=debbugs.gnu.org;
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:from:to:cc:subject:date:message-id:reply-to;
 bh=tv3oTi4cccp6L2oUqGBBlRZLv/LcVFcprE4PEBm+aNU=;
 b=C4spl8h6tOJrCdjidCbKxIj4eJzdBNsyrSAXsnZvCnH7S2mXju1amL4MffmD+7C7cg
 qRf9d2Mdt4fsHzyuoaku9NLop0EYbMchCR8pQ6LIgR5M00ovRUOLIIQZGcYWfS1X7qlu
 RPXTgroAuY/o5XuSLEVDtMZCS6hI66eEKcSFU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1697994548; x=1698599348;
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=tv3oTi4cccp6L2oUqGBBlRZLv/LcVFcprE4PEBm+aNU=;
 b=YksQDyfSvwNMMogkuIslJvhkGxXDQXrtHiqps1icn4dGLB2E5dmkn6W7dfilAjUb36
 MN8MHy2pnJEGbR0EfFP7H2ozf2n193aa4FSMDCtsJE4WvvBeTSPjlWkHCgQlwDxerzw6
 s8C8ftaExi+1G1inRC53F7A6IM6OlA5fkKfiB0P0k9IKKcvdQ7d392VEuf0ZIra4Ftw9
 eZhzHjEL7Atov+qMoIJVPtvf24yg/kmfhqbvIztNlHHwLYidPpMWUSE5mxiWdIXDlTPN
 YKf0jd2AfOuOLgGP9lTxoWBHf4tIM0fvyQjbg03UiOCMKmLNBRQYAdFaMnZuL5ZuMrp1
 x4Ug==
X-Gm-Message-State: AOJu0Yzh40q/FKCEdoybW1IDhJW83I13Q3zS3sWbV7/jX/ekekBlAijN
 zyw73XlWbJff7egqgtBhXg7ofA==
X-Google-Smtp-Source: AGHT+IELYHEuZVhvSvZWOd0wLnHrG/42exQ1AyS1xR+AngbdV8THRfqOrcUB5n48PxwxxLpQGYGonQ==
X-Received: by 2002:a05:600c:4593:b0:401:b504:b6a0 with SMTP id
 r19-20020a05600c459300b00401b504b6a0mr5597021wmo.3.1697994547722; 
 Sun, 22 Oct 2023 10:09:07 -0700 (PDT)
Received: from froglet.home.mavit.org.uk
 (dudl-14-b2-v4wan-165814-cust1925.vm31.cable.virginm.net. [82.34.135.134])
 by smtp.gmail.com with ESMTPSA id
 g18-20020adfa492000000b003232380ffd5sm5985420wrb.106.2023.10.22.10.09.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Oct 2023 10:09:07 -0700 (PDT)
Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1])
 by froglet.home.mavit.org.uk (8.17.1/8.17.1) with ESMTPS id 39MH96S7039745
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Sun, 22 Oct 2023 18:09:06 +0100
Received: from localhost (mavit@localhost)
 by froglet.home.mavit.org.uk (8.17.1/8.17.1/Submit) with ESMTP id
 39MH95hQ039742; Sun, 22 Oct 2023 18:09:06 +0100
X-Authentication-Warning: froglet.home.mavit.org.uk: mavit owned process doing
 -bs
Date: Sun, 22 Oct 2023 18:09:05 +0100 (BST)
From: Peter Oliver <p.d.oliver@HIDDEN>
To: =?ISO-8859-15?Q?Bj=F6rn_Bidar?= <bjorn.bidar@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient --tramp-prefix
 example
In-Reply-To: <65347577.5d0a0220.ab2d6.0249SMTPIN_ADDED_BROKEN@HIDDEN>
Message-ID: <1e698ccf-0f47-5b43-7258-158367d5d92d@HIDDEN>
References: <20231021150127.66683-1-git@HIDDEN>
 <65347577.5d0a0220.ab2d6.0249SMTPIN_ADDED_BROKEN@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="-1463811583-835658128-1697994546=:4056"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1463811583-835658128-1697994546=:4056
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Sun, 22 Oct 2023, Björn Bidar wrote:

>>  @example
>> -local$ ssh -R12345:localhost:12345 remote
>> -remote$ export EDITOR="emacsclient \
>> -        --server-file=server \
>> -        --tramp=/ssh:remote:"
>> +local$ ssh -R "/tmp/emacs-%r.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tmp@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote
>> +remote$ export EMACS_SOCKET_NAME=/tmp/emacs-$USER.socket
>
> If the host has run /run/user it would make sense to setup the Emacs
> socket inside this directory.
> On older systems this might be /var/run/user I think.

It would, sure, but you can’t in general tell from the local side whether the remote side has /run, nor what your UID is there.  You’d need an extra round trip, for which you need ssh’s ControlPersist option to make performant.  This is too complicated for a simple example.

> If the socket fie is in /tmp every other user can read it, using /run/user is
> more secure.

No, the socket will have permissions 0700, so other users won’t be able to read it.  The risk is that other users will be able to cause a nuisance by creating a file of the same name in its place.  Perhaps it’s better to suggest putting the socket in the user’s home directory (which I originally discounted in case of shared NFS home directories)?

-- 
Peter Oliver
---1463811583-835658128-1697994546=:4056--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 22 Oct 2023 16:54:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 22 12:54:27 2023
Received: from localhost ([127.0.0.1]:47978 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qubid-0001cR-Es
	for submit <at> debbugs.gnu.org; Sun, 22 Oct 2023 12:54:27 -0400
Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:60893)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.d.oliver@HIDDEN>) id 1qubiZ-0001cC-4h
 for 66667 <at> debbugs.gnu.org; Sun, 22 Oct 2023 12:54:26 -0400
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2bfed7c4e6dso37450381fa.1
 for <66667 <at> debbugs.gnu.org>; Sun, 22 Oct 2023 09:53:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mavit.org.uk; s=google; t=1697993629; x=1698598429; darn=debbugs.gnu.org;
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:from:to:cc:subject:date:message-id:reply-to;
 bh=mo8lmuGq+AJrjcnHZQIWqM2izoCnlIYUDmbfe+ayW/w=;
 b=Ay9As5O0bVjHyNvtRxyOJbKnDCSnJXQrWclHayE1qG6exDIpEkdIjgNxDnPB4H7FGG
 b0Z1lSkVlKBd2p+uIvSUh7vgnofdw9UZaEE8SPl88eWWKDVoID3FCW0UVtLrkoB5R8OQ
 vztdRznLH6lK8uUZdym6WOU2XqJIWzCmg+ao8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1697993629; x=1698598429;
 h=mime-version:references:message-id:in-reply-to:subject:cc:to:from
 :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=mo8lmuGq+AJrjcnHZQIWqM2izoCnlIYUDmbfe+ayW/w=;
 b=q4XTEMNfXKHecXS0xh9Du6hMf94bXPyXGkdzBnzMEWWyURcSP8//K6pfDWfDvOoEQR
 zmUmXxReU9hKFFTZjsp5hXalYcGslCSU6zPPO/oOWONq5HTAMYoExJU4xe0wj0CwwgYP
 Fz8NDHR/14Y09w7gWQ/UvBRMcxwu0EALyU6rE7dX6dzc/ODHkoqrBRK5hjMvMWEADa2b
 3jWuC06ooFcGl1Mue0MsEeNIwjWs5rGYQ62yDwWdw1csLf0Dov4H5JtYHKufXMjtsn73
 1PG9a1ZBZOYgFIiKgfuuxKNbR8i93kq9zxdZMbhoLsQelOtLUhiVd5y8ikWhyKYzTgaI
 Cxvg==
X-Gm-Message-State: AOJu0Yy2siNAwBpQKm8xfcTx22/KxilaDkFW/sX7WtjqP/xTCs6bgA6U
 Zd7BSltBgQEwPhcnJ3H9DgeY3Q==
X-Google-Smtp-Source: AGHT+IFTE86BOF3/h2ag8IA1JPLID86gjJqSu5KidYHNUYsWELpCGd7AGx99xo3t38Kux92uHW/VBQ==
X-Received: by 2002:a2e:a22c:0:b0:2c5:1bd3:5658 with SMTP id
 i12-20020a2ea22c000000b002c51bd35658mr4659289ljm.28.1697993628622; 
 Sun, 22 Oct 2023 09:53:48 -0700 (PDT)
Received: from froglet.home.mavit.org.uk
 (dudl-14-b2-v4wan-165814-cust1925.vm31.cable.virginm.net. [82.34.135.134])
 by smtp.gmail.com with ESMTPSA id
 v21-20020a05600c12d500b004081a011c0esm11900720wmd.12.2023.10.22.09.53.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Oct 2023 09:53:47 -0700 (PDT)
Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1])
 by froglet.home.mavit.org.uk (8.17.1/8.17.1) with ESMTPS id 39MGrkn2038971
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Sun, 22 Oct 2023 17:53:46 +0100
Received: from localhost (mavit@localhost)
 by froglet.home.mavit.org.uk (8.17.1/8.17.1/Submit) with ESMTP id
 39MGrk0f038968; Sun, 22 Oct 2023 17:53:46 +0100
X-Authentication-Warning: froglet.home.mavit.org.uk: mavit owned process doing
 -bs
Date: Sun, 22 Oct 2023 17:53:46 +0100 (BST)
From: Peter Oliver <p.d.oliver@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient --tramp-prefix
 example
In-Reply-To: <83r0lnovn3.fsf@HIDDEN>
Message-ID: <49e94e2b-874a-c0c8-0c4f-feb1a5ba8c34@HIDDEN>
References: <20231021150127.66683-1-git@HIDDEN> <87v8azsyjs.fsf@HIDDEN>
 <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN> <87pm17rtk7.fsf@HIDDEN>
 <83r0lnovn3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="-1463811583-2125265873-1697993626=:4056"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1463811583-2125265873-1697993626=:4056
Content-Type: text/plain; charset=ISO-8859-7; format=flowed
Content-Transfer-Encoding: 8BIT

On Sun, 22 Oct 2023, Eli Zaretskii wrote:

>> Cc: 66667 <at> debbugs.gnu.org
>> From: Michael Albinus <michael.albinus@HIDDEN>
>> Date: Sun, 22 Oct 2023 09:43:20 +0200
>>
>>> +If you are using a platform that does not have Unix domain sockets
>>> +(i.e., MS-Windows), or SSH implementations that are not able to
>>
>> I'm not sure whether MS-Windows supports UNIX domain sockets or not.
>
> It supports them only ion latest builds of Windows 10 and 11.

I see from lib-src/emacsclient.c that they¢re used only if SOCKETS_IN_FILE_SYSTEM is defined, which is only the case if WINDOWSNT is not defined.  I¢ll update the wording not to imply that they don¢t exist, only that we don¢t use them.

-- 
Peter Oliver
---1463811583-2125265873-1697993626=:4056--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 22 Oct 2023 09:27:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 22 05:27:18 2023
Received: from localhost ([127.0.0.1]:45471 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quUjt-0000Vc-LG
	for submit <at> debbugs.gnu.org; Sun, 22 Oct 2023 05:27:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46076)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1quUjr-0000VJ-4c
 for 66667 <at> debbugs.gnu.org; Sun, 22 Oct 2023 05:27:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1quUjJ-00012X-19; Sun, 22 Oct 2023 05:26:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=mb5iZ0Y70e8NpmCSNRPPfY70k9Yj0NdbNSWy4zljgwI=; b=iPc1unpriayS
 eNrnLJzJg7+wZFSaEZRT5UfiHGc2lSasD3nemDiXLJfRM70lAFGh7VaXAtwAhAWi/gQpk2Tr2pYpB
 RoeXT9nji4qu3O3/Wj2kuINkUu/8WBFhe+9dVYp/1gBXBx6czw2cJ1pZf+ixJzfvL1zLEb9RQH+Ln
 l4FjH0ptpIJV6/JIchJREmv4Dmy1wyLAcHxLePmT5EWZtkixPsLQYRM5IQTgKewxfq6U3Uy5MFrka
 jBx0l9uMcc5UpiSYt8NhSzkbuJ2t3C3cPGiCYNSLPzhizJMcJJbG56IOfuXvh0gNoYBgR0t2E1VFk
 VSnUo6WFWGuU/a0gnSOxfQ==;
Date: Sun, 22 Oct 2023 12:26:40 +0300
Message-Id: <83r0lnovn3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
In-Reply-To: <87pm17rtk7.fsf@HIDDEN> (message from Michael Albinus on Sun, 22
 Oct 2023 09:43:20 +0200)
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient --tramp-prefix
 example
References: <20231021150127.66683-1-git@HIDDEN> <87v8azsyjs.fsf@HIDDEN>
 <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN>
 <87pm17rtk7.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org, p.d.oliver@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 66667 <at> debbugs.gnu.org
> From: Michael Albinus <michael.albinus@HIDDEN>
> Date: Sun, 22 Oct 2023 09:43:20 +0200
> 
> > +If you are using a platform that does not have Unix domain sockets
> > +(i.e., MS-Windows), or SSH implementations that are not able to
> 
> I'm not sure whether MS-Windows supports UNIX domain sockets or not.

It supports them only ion latest builds of Windows 10 and 11.

> Eli, can we still install it in the emacs-29 branch?

Yes, thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 22 Oct 2023 07:44:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 22 03:44:02 2023
Received: from localhost ([127.0.0.1]:45426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quT7x-0005bl-Ja
	for submit <at> debbugs.gnu.org; Sun, 22 Oct 2023 03:44:01 -0400
Received: from mout.gmx.net ([212.227.15.19]:57275)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1quT7s-0005bU-AM
 for 66667 <at> debbugs.gnu.org; Sun, 22 Oct 2023 03:43:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417;
 t=1697960601; x=1698565401; i=michael.albinus@HIDDEN;
 bh=d8rkONupqklBbERh2sf1af9aPYm6Jp4SPjiKz34QqZU=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:
 Date;
 b=JNTP+3L3OnYM1WjpWLAiacPpW7nRKjIfLkF76e8QQVUHg3p6rd82BFsOqPrFe+jy
 knMvP/sTSYQy5JZRq/E5vPgQux+77PV3o3xi/+CXfcjA/iykcwE0XwpV3/dQ6gHkp
 tgxO/Uo7HMsTlOuUTjPP3Yuc4M+6vcpQg8jGoTNDQa7HOvkWlC+w5BdDuz9hSOjaD
 Z3jTjy9DFdpeZrsEyM+O1mpcfwD8WI9u4L4vsCWWvoBTgVdYuCBgU3yv/odbRQJZ/
 kgOturDOJNMhbREPaVaXO47DQWFHBenLg+p1k5FRpijeVv4h2fYaQAVj/wnwLaAO7
 xDHSuRUuraMtzelU7g==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6KYl-1raMSn4BrN-016iFs; Sun, 22
 Oct 2023 09:43:21 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Peter Oliver <p.d.oliver@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient
 --tramp-prefix example
In-Reply-To: <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN> (Peter
 Oliver's message of "Sat, 21 Oct 2023 20:28:17 +0100 (BST)")
References: <20231021150127.66683-1-git@HIDDEN> <87v8azsyjs.fsf@HIDDEN>
 <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN>
Date: Sun, 22 Oct 2023 09:43:20 +0200
Message-ID: <87pm17rtk7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:blVHK5//n/CFQGARFOLszJcHDu0ZMLullenRDz5VC1PK/fliS3D
 XmFAVCJdpKfS7NYZYbWHZ6agjD6beoA+wwNyWxCIRhoJ6VYoxHpnrarIQdn6sDLV6QC1TVA
 7X5q/fVPj+dfj0J4PdYHLtpI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tilGNiaF2xQz/Vrzx8wvC9Z+3FFP7MUK8fquIoqvYvsso5Wsr
 d8egZA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Peter Oliver <p.d.oliver@HIDDEN> writes:

Hi Peter,

> So, I=E2=80=99m not certain that one and a half examples is better than o=
ne complete example, but, anyway, here=E2=80=99s an updated patch.

Thanks. LGTM, just two nits:

> +If you are using a platform that does not have Unix domain sockets
> +(i.e., MS-Windows), or SSH implementations that are not able to

I'm not sure whether MS-Windows supports UNIX domain sockets or not. Eli
might know this.

> +forward them (e.g., OpenSSH before version 6.7), you can forward a TCP
> +port instead.  In this example, assume that the local Emacs listens on
> +tcp port 12345.  Assume further that
>  @file{/home} is on a shared file system, so that the server file
>  @file{~/.emacs.d/server/server} is readable on both hosts.
>
>  @example
>  local$ ssh -R12345:localhost:12345 remote
> -remote$ export EDITOR=3D"emacsclient \
> -        --server-file=3Dserver \
> -        --tramp=3D/ssh:remote:"
> +remote$ export EMACSCLIENT_TRAMP=3D/ssh:remote:
> +remote$ export EDITOR=3Demacsclient

Here we need also

remote$ export EMACS_SERVER_FILE=3Dserver

Otherwise, the "Implicit local socket" rule comes to play, see
set_socket in emacsclient.c.

Otherwise, it is fine. Eli, can we still install it in the emacs-29 branch?

And another question. You have already contributed to Emacs. That
contribution, and your proposed changes here and in bug#66598 bring you
close to the limit of changes (~15 lines), which are accepted without
formal paperwork. In order to make further contributions from you
possible: would you like to assign the copyright of your future
contributions to the Free Software Foundation?

> Peter Oliver

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 22 Oct 2023 01:06:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 21:06:43 2023
Received: from localhost ([127.0.0.1]:45246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quMvP-0000Xd-Lf
	for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 21:06:43 -0400
Received: from thaodan.de ([185.216.177.71]:46306)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <bjorn.bidar@HIDDEN>) id 1quMvJ-0000XI-0v
 for 66667 <at> debbugs.gnu.org; Sat, 21 Oct 2023 21:06:38 -0400
Received: from odin (dsl-trebng12-50dc77-87.dhcp.inet.fi [80.220.119.87])
 by thaodan.de (Postfix) with ESMTPSA id 3E8F4D08C7F;
 Sun, 22 Oct 2023 04:05:58 +0300 (EEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail;
 t=1697936758; bh=9mHrsfwdEOdm8xgXEmM8e44q0bIiKtzLx7Zf/96JK7w=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=gpBZBFWz/LlqUWFNDXSaZNHGdZpY4uk48aaI3ZohxX4r02LMh5DhH9phmxALO4t0B
 +wd7SU6PQWDJPpd64Pu5DReWnC38EaXwMvTe1fXoVsKgbZiFfNeD7yPSGylHToZPbT
 fHkoIQ/hH0yYJZv2xnTiEtwvwgrF2YRFAIHoquQ+HCcdEwBElH/qt3EPmqi1nEP6Ak
 A49Q32D1re7YQUEid7kOTOK3uapSkf+1aZ1xS074tuUY8KvhJ67V9MNALvMLwpW64j
 3t8HMlaGNLiaN0BE47O/5i7gdUHepKpwFaS4lvGSuww3GJyALlQBzmYylVCfy/9ZSc
 Qcs3ycZXkB4xXIL8Vza4fPHjvASQ+UONqrbt+sD5P9s/s57XiJLH5wodCjsxL638gW
 SIQa3rLR7rPuPWmBT1LQYDnno2UUCghNPKZDZPisyJnmsHLJsv11dqgnu4B2ajRMJG
 KqHzBQgiWfFSc2YrwtOcSW+fwoHigGV0EIPybrVrXaqiipHebOc9/QtPsqjhbXEV4L
 wZywvWchkH9F69pBBkieicQFSyGfjZvkfm3HAUlf+OfhybM45vLoxYhPs/A0xqcvJ1
 99WtOnCWsaALHdo8Dn1sZUniBF1VrSAZo4glljpG5fiNX1TuHSu+qHr37Xp6fPSCDV
 PjH+T0x3y7SjIKwJUZquwTW4=
From: =?utf-8?Q?Bj=C3=B6rn?= Bidar <bjorn.bidar@HIDDEN>
To: Peter Oliver <p.d.oliver@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient
 --tramp-prefix example
In-Reply-To: <20231021150127.66683-1-git@HIDDEN> (Peter Oliver's message
 of "Sat, 21 Oct 2023 16:01:27 +0100")
References: <20231021150127.66683-1-git@HIDDEN>
Autocrypt: addr=bjorn.bidar@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq
 w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV
 CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzA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QB2kcPAQEHQAgRJq/tMcCCB2XyA5WZpu7GvpRx0m9IPRWazeqhOq7uiO8EGBYKACAWIQRR8Xbr
 dUcwHqcpqKtcG3ShZRxfaAUCZNf71AIbIgCBCRBcG3ShZRxfaHYgBBkWCgAdFiEEUfF263VHMB6n
 KairXBt0oWUcX2gFAmTX+9QACgkQXBt0oWUcX2jeSwD6AtWn0cuo8IF35YRo4o3cDRJnUfJnbvJy
 GxyCDThR+zYBAKG6/jdwmZkBQZKslnDAbMMd2WfiZZT5JW3IWC4EaKMO7HkBAKYPGZ3UbfkRvfFK
 S+pQ9CgtNfkSJQBtT1Ob7Y6nsacgAQCpyXN7yppmhW/oBgivITPy9Lkg+V4NK9WZYZCU9Q7LBA==
Date: Sun, 22 Oct 2023 04:05:57 +0300
Message-ID: <87il6zihze.fsf@>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Peter Oliver <p.d.oliver@HIDDEN> writes: > Previously, 
 the emacsclient --tramp-prefix documentation suggested > using it in
 conjunction
 with a forwarded TCP port. However, OpenSSH > has supported forwarding sockets
 since version 6.7 (release [...] 
 Content analysis details:   (1.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 1.2 INVALID_MSGID          Message-Id is not valid, according to RFC 2822
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org, Peter Oliver <git@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)

Peter Oliver <p.d.oliver@HIDDEN> writes:

> Previously, the emacsclient --tramp-prefix documentation suggested
> using it in conjunction with a forwarded TCP port.  However, OpenSSH
> has supported forwarding sockets since version 6.7 (released 2014), so
> let=E2=80=99s suggest that instead.  Sockets require less manual configur=
ation
> than ports, are less likely to clash, and are more secure, so will be
> a better choice for the majority of people looking to set up this
> facility for the first time.
>
> * doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.
> ---
>  doc/emacs/misc.texi | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
> index a05b7f6c6ea..93771832ff5 100644
> --- a/doc/emacs/misc.texi
> +++ b/doc/emacs/misc.texi
> @@ -2158,8 +2158,9 @@ emacsclient Options
>  Set the prefix to add to filenames for Emacs to locate files on remote
>  machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp
>  Manual,, tramp, The Tramp Manual}).  This is mostly useful in
> -combination with using the Emacs server over TCP (@pxref{TCP Emacs
> -server}).  By ssh-forwarding the listening port and making the
> +combination with using the Emacs server from a remote host.  By
> +ssh-forwarding the listening socket, or ssh-forwarding the listening
> +port @pxref{TCP Emacs server} and making the
>  @var{server-file} available on a remote machine, programs on the
>  remote machine can use @command{emacsclient} as the value for the
>  @env{EDITOR} and similar environment variables, but instead of talking
> @@ -2171,16 +2172,13 @@ emacsclient Options
>  effect as using the @samp{-T} option.  If both are specified, the
>  command-line option takes precedence.
>=20=20
> -For example, assume two hosts, @samp{local} and @samp{remote}, and
> -that the local Emacs listens on tcp port 12345.  Assume further that
> -@file{/home} is on a shared file system, so that the server file
> -@file{~/.emacs.d/server/server} is readable on both hosts.
> +For example, assume two hosts, @samp{local} and @samp{remote}.
>=20=20
>  @example
> -local$ ssh -R12345:localhost:12345 remote
> -remote$ export EDITOR=3D"emacsclient \
> -        --server-file=3Dserver \
> -        --tramp=3D/ssh:remote:"
> +local$ ssh -R "/tmp/emacs-%r.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tm=
p@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote
> +remote$ export EMACS_SOCKET_NAME=3D/tmp/emacs-$USER.socket
If the host has run /run/user it would make sense to setup the Emacs
socket inside this directory.
If the socket fie is in /tmp every other user can read it, using /run/user =
is
more secure.
On older systems this might be /var/run/user I think.

> +remote$ export EMACSCLIENT_TRAMP=3D/ssh:remote:
> +remote$ export EDITOR=3Demacsclient
>  remote$ $EDITOR /tmp/foo.txt #Should open in local emacs.
>  @end example




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 21 Oct 2023 19:28:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 15:28:57 2023
Received: from localhost ([127.0.0.1]:45097 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quHea-0001GF-L7
	for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 15:28:57 -0400
Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:58453)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <p.d.oliver@HIDDEN>) id 1quHeY-0001Fx-FT
 for 66667 <at> debbugs.gnu.org; Sat, 21 Oct 2023 15:28:55 -0400
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2c50ec238aeso28016421fa.0
 for <66667 <at> debbugs.gnu.org>; Sat, 21 Oct 2023 12:28:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mavit.org.uk; s=google; t=1697916500; x=1698521300; darn=debbugs.gnu.org;
 h=content-id:mime-version:references:message-id:in-reply-to:subject
 :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
 bh=8tYlJjMbcOwbyob3TjLObOyKv3DYL6cWg3RJfnR7kiI=;
 b=W53uNNGg/sXqpl/qLf5dMyTLB20PEPci0my9/YOCjM17iKuNnaJpM5qtD3niSG4QUN
 8G140efCo5SvzMM4VFxIYuP4sx3w41KhAp1tTrMUcs4vFar0Qr6/h8pJDxDbizKVsXLf
 11qeiEGnd1vfc8w4RpP+IWV/qn406nKYiBokg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1697916500; x=1698521300;
 h=content-id:mime-version:references:message-id:in-reply-to:subject
 :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=8tYlJjMbcOwbyob3TjLObOyKv3DYL6cWg3RJfnR7kiI=;
 b=KMFyhE9KGl5XXdRhUwq7xYE1pKv3geWK0UPtFWR4TBmEtyCJ+eeSMODvrAmTNDjy+C
 VF1fvmPxo4S2eYTd8MkMh4bqQaFn4sSgTKRySvMNdysNm+gp1qe2LRIAN91y+x9Kz8Df
 ppzRWJntBdyLzqTqXe37PQkc8eCeQc4yXvKPOAmO5d8w7fOfCk35rct9JN6aJHsxogZg
 KbI7u6hXyQeHcDJmsLTNqk3EFtONM01rmTQu0uy6J3vn/Wd5kseVJM/t7g1m+S06vmow
 jbT31ZNsU1cd/GSW1b3+vZ7q7hYWOeGJ0oJMo5qGyc9Ma4qNvcwitoC6H8DezyAaa4u8
 mOcw==
X-Gm-Message-State: AOJu0YyyVajBW01CU8947bqFGsP+PzYvsuCE8TKdL9T540AL3Fmse3gW
 5pWhHUTiKD+0LLiB9CYt9SgURQ==
X-Google-Smtp-Source: AGHT+IEiMxxMHzq+KxhTbSTQDMAjenVnFaCmd4LSEiVon9p7U6ZrOpigH5A0uHmsK2uFa/S3I6wHhQ==
X-Received: by 2002:a2e:984b:0:b0:2c5:3339:71d6 with SMTP id
 e11-20020a2e984b000000b002c5333971d6mr3408553ljj.19.1697916499655; 
 Sat, 21 Oct 2023 12:28:19 -0700 (PDT)
Received: from froglet.home.mavit.org.uk
 (dudl-14-b2-v4wan-165814-cust1925.vm31.cable.virginm.net. [82.34.135.134])
 by smtp.gmail.com with ESMTPSA id
 n16-20020a05600c3b9000b003fee6e170f9sm5231658wms.45.2023.10.21.12.28.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 Oct 2023 12:28:19 -0700 (PDT)
Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1])
 by froglet.home.mavit.org.uk (8.17.1/8.17.1) with ESMTPS id 39LJSH4g099508
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Sat, 21 Oct 2023 20:28:18 +0100
Received: from localhost (mavit@localhost)
 by froglet.home.mavit.org.uk (8.17.1/8.17.1/Submit) with ESMTP id
 39LJSHrW099505; Sat, 21 Oct 2023 20:28:17 +0100
X-Authentication-Warning: froglet.home.mavit.org.uk: mavit owned process doing
 -bs
Date: Sat, 21 Oct 2023 20:28:17 +0100 (BST)
From: Peter Oliver <p.d.oliver@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient --tramp-prefix
 example
In-Reply-To: <87v8azsyjs.fsf@HIDDEN>
Message-ID: <6f458d1e-a536-7b90-2027-077c9767677b@HIDDEN>
References: <20231021150127.66683-1-git@HIDDEN> <87v8azsyjs.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 BOUNDARY="-1463811583-926039267-1697914409=:4090"
Content-ID: <ac7c8df7-c967-83c5-d6c8-53f46e896ffe@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1463811583-926039267-1697914409=:4090
Content-Type: text/plain; CHARSET=ISO-8859-7; format=flowed
Content-Transfer-Encoding: 8BIT
Content-ID: <a9970525-2e6c-8ca9-63b7-8c399ee4ed4a@HIDDEN>

On Sat, 21 Oct 2023, Michael Albinus wrote:

> Think about routers, NAS systems, and alike, which aren't upgraded over
> years.

You¢re right about these kinds of systems, of course, but the old example already left a lot as an exercise for the reader: it assumes that you¢d suitably configured server-port and server-use-tcp, then somehow made ~/.emacs.d/server/server accessible to the client.  Deciding on a suitable ssh -R argument for TCP forwarding doesn¢t seem like the hardest part.

So, I¢m not certain that one and a half examples is better than one complete example, but, anyway, here¢s an updated patch.

-- 
Peter Oliver
---1463811583-926039267-1697914409=:4090
Content-Type: text/plain; charset=UTF-8; name=0001-Socket-forwarding-in-emacsclient-tramp-prefix-exampl.patch
Content-Transfer-Encoding: BASE64
Content-ID: <4129e1c4-efb7-8d42-abfb-cb1bf974b2fe@HIDDEN>
Content-Description: 
Content-Disposition: attachment; filename=0001-Socket-forwarding-in-emacsclient-tramp-prefix-exampl.patch

RnJvbSAwNjdhNTE2ZmEyZDAwMjAxNzBiOTc2MDJkOTNlYjlmNTg5MDg2ZDAx
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogUGV0ZXIgT2xpdmVy
IDxnaXRAbWF2aXQub3JnLnVrPg0KRGF0ZTogU2F0LCAyMSBPY3QgMjAyMyAx
NTo1NTowMyArMDEwMA0KU3ViamVjdDogW1BBVENIXSBTb2NrZXQgZm9yd2Fy
ZGluZyBpbiBlbWFjc2NsaWVudCAtLXRyYW1wLXByZWZpeCBleGFtcGxlDQpN
SU1FLVZlcnNpb246IDEuMA0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBj
aGFyc2V0PVVURi04DQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0
DQoNClByZXZpb3VzbHksIHRoZSBlbWFjc2NsaWVudCAtLXRyYW1wLXByZWZp
eCBkb2N1bWVudGF0aW9uIHN1Z2dlc3RlZA0KdXNpbmcgaXQgaW4gY29uanVu
Y3Rpb24gd2l0aCBhIGZvcndhcmRlZCBUQ1AgcG9ydC4gIEhvd2V2ZXIsIE9w
ZW5TU0gNCmhhcyBzdXBwb3J0ZWQgZm9yd2FyZGluZyBzb2NrZXRzIHNpbmNl
IHZlcnNpb24gNi43IChyZWxlYXNlZCAyMDE0KSwgc28NCmxldOKAmXMgc3Vn
Z2VzdCB0aGF0IGluc3RlYWQuICBTb2NrZXRzIHJlcXVpcmU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
dGhhdA0KIEBmaWxley9ob21lfSBpcyBvbiBhIHNoYXJlZCBmaWxlIHN5c3Rl
bSwgc28gdGhhdCB0aGUgc2VydmVyIGZpbGUNCiBAZmlsZXt+Ly5lbWFjcy5k
L3NlcnZlci9zZXJ2ZXJ9IGlzIHJlYWRhYmxlIG9uIGJvdGggaG9zdHMuDQog
DQogQGV4YW1wbGUNCiBsb2NhbCQgc3NoIC1SMTIzNDU6bG9jYWxob3N0OjEy
MzQ1IHJlbW90ZQ0KLXJlbW90ZSQgZXhwb3J0IEVESVRPUj0iZW1hY3NjbGll
bnQgXA0KLSAgICAgICAgLS1zZXJ2ZXItZmlsZT1zZXJ2ZXIgXA0KLSAgICAg
ICAgLS10cmFtcD0vc3NoOnJlbW90ZToiDQorcmVtb3RlJCBleHBvcnQgRU1B
Q1NDTElFTlRfVFJBTVA9L3NzaDpyZW1vdGU6DQorcmVtb3RlJCBleHBvcnQg
RURJVE9SPWVtYWNzY2xpZW50DQogcmVtb3RlJCAkRURJVE9SIC90bXAvZm9v
LnR4dCAjU2hvdWxkIG9wZW4gaW4gbG9jYWwgZW1hY3MuDQogQGVuZCBleGFt
cGxlDQogDQotLSANCjIuNDEuMA0KDQo=

---1463811583-926039267-1697914409=:4090--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at 66667 <at> debbugs.gnu.org:


Received: (at 66667) by debbugs.gnu.org; 21 Oct 2023 16:58:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 12:58:45 2023
Received: from localhost ([127.0.0.1]:44945 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quFJB-0004c0-HG
	for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 12:58:45 -0400
Received: from mout.gmx.net ([212.227.15.19]:45725)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1quFJ5-0004be-1k
 for 66667 <at> debbugs.gnu.org; Sat, 21 Oct 2023 12:58:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417;
 t=1697907480; x=1698512280; i=michael.albinus@HIDDEN;
 bh=h6zf5tgVVWDy45VffwFEgEm8Ad75dGMXi7QZpXSLG9g=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:
 Date;
 b=XsitP0vcPbmXwWQXJtoLjZZF8hbGw/o1NwMsBhcl2IrpIdaT7+dHaKwrPHzid2ri
 Y/fnG9jRgJYL1hS+JsyG4Amw8vXBItcwcbo8zPSOtV/+Qv0flhA9y+pF6YGBwLj2g
 rqocacdaqh9IENpBwgkCW8vLs5PZF6Ar8G2Uc9Yxx4esYnMYf2a4056xqrM2CgQJT
 prQtwpgpat2HZcG023Svq2C2dX9sxudG2wyjoXUolm2XCkWGepkVtLO2aYawk635R
 QyBPlVm38GfAL0X1ep68CodoyKRf6AYEvYyKws3acKaR4qJxPXiwFdqNwOcP4OQft
 CsE0e4VChtdMiDwDSQ==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSc1L-1r5dBZ0vZB-00Szog; Sat, 21
 Oct 2023 18:58:00 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Peter Oliver <p.d.oliver@HIDDEN>
Subject: Re: bug#66667: [PATCH] Socket forwarding in emacsclient
 --tramp-prefix example
In-Reply-To: <20231021150127.66683-1-git@HIDDEN> (Peter Oliver's message
 of "Sat, 21 Oct 2023 16:01:27 +0100")
References: <20231021150127.66683-1-git@HIDDEN>
Date: Sat, 21 Oct 2023 18:57:59 +0200
Message-ID: <87v8azsyjs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:1jncUSA80zdDUUGIyXiCGm5Tx598sdhbsQru4AnixtLhkGZcVde
 BsHGDyHscfU006nWUJRABiyz5q6fMqUMIt8tUrelCmmT8+I3OJSwyG6bL1XYxAXSlEG6ZPL
 kBa4EuKpkG0M7JlY+ZrUqwl1mklalMsufOqYLiI77tayvtUsxqxmzppxmP/P1+QjATOa9IQ
 mzyG7YZuMX6CNoYMpOMEw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:fOFzVCismR8=;joZ2yeZDt4/TVUYB1dN+5v6P7ki
 BrwqTzTBPUliAlO0ZTpCOrG2mIiKiK3jAElY1YUwNLDDIMGI+kI8K/ks7XTZvjXAeZ94rT7B+
 BZGuSc+KYiuutex+QMytu+WRTp2r/vB2/ciolXI2Rnxyjc1UT4MiKmtm/fgXcNSAq2K41lDJz
 vJIBSholRbIyn4N/IOduNFqW+jJ4zp47Sm3WrqVBfdvqNo5mQeL6r9sVf6Tqm4uvYqRY/Bw4e
 dZY0rMzOwOCkGjifETOQsSUxX+I10k/KRbAw1UI4qKJ+Oz826Q9bHILMhFaokmicJg0qGb0XH
 9LcyV1bSbSAEx6evsm8YfGbxGbIqt+XIWm++FU638yXSGIm7EklwwzSCXR5xWvWSdH/hSYbg8
 YdMMzU83VrXfvmcxGNqZ6VPnwnz0qYaNz9cn7LUZqWq+opHnExKCtf+beUp3GEfcdRd4MCp6G
 zthAnVO9MfndGk13U4dRcKcksk119zjunucaQqzE34R0pFfe6+0KxDHABBlMO8qGzUiLd4CpE
 aOys51YpzTiFD8mn03wIBLABinhDLFG1/ZVRxu60Nj6YRKoh2ul11B+kZh1+jpcAitlMKpwHO
 OZ2E5wxxHPvwWBakj7DQaEnP4JRW9NePnf1u1V6Zos4X8f8nwCEsayyMgpN7peCya2y5ZmXaB
 gQvQpug3khysnNyjufSHvVXKTl8MYZYVaBZiwq/lJA0r5GGqag/AXy9sQRqWxrITnsScts9R+
 pLpmFkocDT9mnI+j/6BIETbaQiB67++DskwwYE3U78lhTtzMJgXe7g9O1vhR6hjbHnpw+n8IU
 T2GDwvJjcdscGDwCrCM5zlFdGyRoCpREbpVZegK9zU/aKCtJQD/IPwLfoQXCB4vivE3tbusLk
 CWvj9FIaZMLHIw7mz3yny9mn0a9jIHH0uG91z2C5iQi4M39FkJtb5MPIZrUfodk4PUrJLq7LF
 heVTjg==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 66667
Cc: 66667 <at> debbugs.gnu.org, Peter Oliver <git@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Peter Oliver <p.d.oliver@HIDDEN> writes:

Hi Peter,

> Previously, the emacsclient --tramp-prefix documentation suggested
> using it in conjunction with a forwarded TCP port.  However, OpenSSH
> has supported forwarding sockets since version 6.7 (released 2014), so
> let=E2=80=99s suggest that instead.  Sockets require less manual configur=
ation
> than ports, are less likely to clash, and are more secure, so will be
> a better choice for the majority of people looking to set up this
> facility for the first time.

Thanks for this. However, I don't believe we shall document this instead
of server ports. Better would be to document both variants. The reason
is, that sockets don't exists on every platform, see the "#ifdef
SOCKETS_IN_FILE_SYSTEM" directive in emacsclient.c.

Furthermore, people might run older sshd servers on remote systems,
which don't support socket forwarding. It must be also at least OpenSSH
6.7, like the client on the local side. Think about routers, NAS
systems, and alike, which aren't upgraded over years. As Tramp
maintainer I know what I'm speaking about.

The %TOKEN percent expansion (your %r and %i tokens) exists since
OpenSSH 8.2 only.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Oct 2023 15:02:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 21 11:02:47 2023
Received: from localhost ([127.0.0.1]:44871 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1quDV1-0000rC-1K
	for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 11:02:47 -0400
Received: from lists.gnu.org ([2001:470:142::17]:45062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mavit@HIDDEN>) id 1quDUw-0000qu-Sr
 for submit <at> debbugs.gnu.org; Sat, 21 Oct 2023 11:02:45 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mavit@HIDDEN>)
 id 1quDUP-0005sd-Bu
 for bug-gnu-emacs@HIDDEN; Sat, 21 Oct 2023 11:02:09 -0400
Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <mavit@HIDDEN>)
 id 1quDUK-0005Fm-O0
 for bug-gnu-emacs@HIDDEN; Sat, 21 Oct 2023 11:02:08 -0400
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-507ad511315so2661354e87.0
 for <bug-gnu-emacs@HIDDEN>; Sat, 21 Oct 2023 08:02:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mavit.org.uk; s=google; t=1697900521; x=1698505321; darn=gnu.org;
 h=content-transfer-encoding:mime-version:reply-to:message-id:date
 :subject:cc:to:from:sender:from:to:cc:subject:date:message-id
 :reply-to; bh=S8/GGU1I/6Wmi+BbwB/hv1aBMwBQ++PjNpOhYXZRzok=;
 b=WuIMsQJrfbW3mpmj6BpiNUJNE8L4qsU3GLxn/ZYPYqmVEbowxPxDlSrEZpDhXTAA8t
 g3iWeoRdqR0jgV66ONEbospvJl5JKPEoSQR+4kc6vUZ9sqsL4IpyCP+6ZnnIqhTI4EKS
 oIzNzJYvCWJAuT9IiWK/6A0bWA/LJhiBmu5hw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1697900521; x=1698505321;
 h=content-transfer-encoding:mime-version:reply-to:message-id:date
 :subject:cc:to:from:sender:x-gm-message-state:from:to:cc:subject
 :date:message-id:reply-to;
 bh=S8/GGU1I/6Wmi+BbwB/hv1aBMwBQ++PjNpOhYXZRzok=;
 b=UcjoTu6srI4VUCbvCjrcstL7jJSZdy5bHHWMwWJYkzSP0XPhmcNo7/n1092AFeTjnK
 RlrOJv/Hx9DpSYNii3HRwBLC/gr2/pHlIQgg6+7v0ePe4tszzBa2OddqCzbd2NEhNnDJ
 ZlmdRtldDIfMIPf/RxKmbX5hpeiBU+m2P1avFXFdbPWxTCBQHw369tDr/TMcxhzp/I3G
 AFshIaArstPnHpfHr2GQLulp4jKVSUZHxdW3jqJWR2xXOapFKbmDd2Uhv5ykTGTRQABL
 x0uaHqvZnIqO0NFMSlcgKlVxuKDAjoBxpyzWs+Yk2uuOOzKBGtng0DbFwxV6fy3W9iPh
 oIQQ==
X-Gm-Message-State: AOJu0YwXQBY0B+OVt2pbbm/cUE15Yq80sROznpiG1v0tUCno2/rnNoOm
 hkUmLJ3OORQ1XUC9UpD/IXQJvAALEjTL3vU7lMQ=
X-Google-Smtp-Source: AGHT+IFxVnOsAesMAgeIeFx6ntkkg77dS7Ov9f6noz9ZFhksUhxfQ9u7dPyhQ7sZ8cz93CGmFmnU1g==
X-Received: by 2002:a2e:7a0b:0:b0:2c5:1075:5ec9 with SMTP id
 v11-20020a2e7a0b000000b002c510755ec9mr3008759ljc.13.1697900521402; 
 Sat, 21 Oct 2023 08:02:01 -0700 (PDT)
Received: from froglet.home.mavit.org.uk
 (dudl-14-b2-v4wan-165814-cust1925.vm31.cable.virginm.net. [82.34.135.134])
 by smtp.gmail.com with ESMTPSA id
 1-20020a05600c028100b004077219aed5sm9422639wmk.6.2023.10.21.08.02.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 Oct 2023 08:02:01 -0700 (PDT)
From: Peter Oliver <p.d.oliver@HIDDEN>
X-Google-Original-From: Peter Oliver <git@HIDDEN>
Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1])
 by froglet.home.mavit.org.uk (8.17.1/8.17.1) with ESMTPS id 39LF1x63066740
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Sat, 21 Oct 2023 16:02:00 +0100
Received: (from mavit@localhost)
 by froglet.home.mavit.org.uk (8.17.1/8.17.1/Submit) id 39LF1xvr066739;
 Sat, 21 Oct 2023 16:01:59 +0100
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Socket forwarding in emacsclient --tramp-prefix example
Date: Sat, 21 Oct 2023 16:01:27 +0100
Message-ID: <20231021150127.66683-1-git@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::136;
 envelope-from=mavit@HIDDEN; helo=mail-lf1-x136.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,
 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-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
Cc: Peter Oliver <git@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: p.d.oliver@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Previously, the emacsclient --tramp-prefix documentation suggested
using it in conjunction with a forwarded TCP port.  However, OpenSSH
has supported forwarding sockets since version 6.7 (released 2014), so
let’s suggest that instead.  Sockets require less manual configuration
than ports, are less likely to clash, and are more secure, so will be
a better choice for the majority of people looking to set up this
facility for the first time.

* doc/emacs/misc.texi (emacsclient Options): Suggest forwarding sockets.
---
 doc/emacs/misc.texi | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index a05b7f6c6ea..93771832ff5 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2158,8 +2158,9 @@ emacsclient Options
 Set the prefix to add to filenames for Emacs to locate files on remote
 machines (@pxref{Remote Files}) using TRAMP (@pxref{Top, The Tramp
 Manual,, tramp, The Tramp Manual}).  This is mostly useful in
-combination with using the Emacs server over TCP (@pxref{TCP Emacs
-server}).  By ssh-forwarding the listening port and making the
+combination with using the Emacs server from a remote host.  By
+ssh-forwarding the listening socket, or ssh-forwarding the listening
+port @pxref{TCP Emacs server} and making the
 @var{server-file} available on a remote machine, programs on the
 remote machine can use @command{emacsclient} as the value for the
 @env{EDITOR} and similar environment variables, but instead of talking
@@ -2171,16 +2172,13 @@ emacsclient Options
 effect as using the @samp{-T} option.  If both are specified, the
 command-line option takes precedence.
 
-For example, assume two hosts, @samp{local} and @samp{remote}, and
-that the local Emacs listens on tcp port 12345.  Assume further that
-@file{/home} is on a shared file system, so that the server file
-@file{~/.emacs.d/server/server} is readable on both hosts.
+For example, assume two hosts, @samp{local} and @samp{remote}.
 
 @example
-local$ ssh -R12345:localhost:12345 remote
-remote$ export EDITOR="emacsclient \
-        --server-file=server \
-        --tramp=/ssh:remote:"
+local$ ssh -R "/tmp/emacs-%r.socket":"$@{XDG_RUNTIME_DIR:-$@{TMPDIR:-/tmp@}/emacs%i@}$@{XDG_RUNTIME_DIR:+/emacs@}/server" remote
+remote$ export EMACS_SOCKET_NAME=/tmp/emacs-$USER.socket
+remote$ export EMACSCLIENT_TRAMP=/ssh:remote:
+remote$ export EDITOR=emacsclient
 remote$ $EDITOR /tmp/foo.txt #Should open in local emacs.
 @end example
 
-- 
2.41.0





Acknowledgement sent to p.d.oliver@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#66667; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 8 Apr 2024 12:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.