unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: "Josselin Poiret" <dev@jpoiret.xyz>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Ludovic Courtès" <ludo@gnu.org>,
	74832@debbugs.gnu.org, "Christopher Baines" <guix@cbaines.net>
Subject: bug#74832: guix copy incorrectly assumes port is 22
Date: Thu, 19 Dec 2024 10:30:39 +0100	[thread overview]
Message-ID: <8734ik6mv4.fsf@wolfsden.cz> (raw)
In-Reply-To: <87ikrgmmfm.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Thu,  19 Dec 2024 11:33:17 +0900")

[-- Attachment #1: Type: text/plain, Size: 2665 bytes --]

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Tomas,
>
> Tomas Volf <~@wolfsden.cz> writes:
>
>> After update to guile-ssh 0.18.0, options passed to the `make-session'
>> procedure now take precedence over the configuration file.  In few places we
>> however had code like `(or port 22)' leading to (in absence of alternative
>> port being specified) always using port 22, ignoring the configuration file.
>>
>> Due to that for example following command fails:
>>
>>     guix copy hello --to=name
>>
>> Name is reachable, but ssh server listens on port 2222.  That is correctly
>> configured in ~/.ssh/config, and the invocation used to succeed until the
>> upgrade.
>
> That is curious, because I had reported the exact same problem 6 years
> ago (!) in bug#33266 (now merged with this one), with a similar
> solution:
>
> Subject: [PATCH] Revert "copy: Default to port 22."
>
> This reverts commit cc1dfc202f2fefb6c2eb9467d1fc90a9154550c9.  Specifying a
> default port had the undesirable effect of disregarding a port specification
> for a given host in the ~/.ssh/config that would otherwise have been honored
> at the time `open-ssh-session' calls the `session-parse-config!' method.
>
> In any case, `make-session' will default the port value of the created session
> to 22 if left unspecified.
>
>
> But, Ludovic had mentioned that without it,
>
> [...] "%p" would be "0" when using "ProxyCommand" in ~/.ssh/config.
>
> So it'd perhaps regress in another way; I want to retry the test I had
> done then but I need to setup at least a VM with SSH to test.  If you
> can beat me to that, all the better :-).

I wonder whether VM is necessary.  I added the following to my
~/.ssh/config file:

--8<---------------cut here---------------start------------->8---
host name
port 2222
proxycommand echo %p >/tmp/port
--8<---------------cut here---------------end--------------->8---

Then I executed guix copy:

--8<---------------cut here---------------start------------->8---
$ guix copy hello --to=name
guix copy: error: SSH connection to 'name' port 2222 failed: Socket error: Connection reset by peer
--8<---------------cut here---------------end--------------->8---

And after that I checked /tmp:

--8<---------------cut here---------------start------------->8---
$ cat /tmp/port 
2222
--8<---------------cut here---------------end--------------->8---

So it seems to work fine?  Would not hurt if someone double checked
(with the patch above applied).

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

      reply	other threads:[~2024-12-19  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 16:45 bug#74832: guix copy incorrectly assumes port is 22 Dariqq
2024-12-12 17:35 ` Tomas Volf
2024-12-12 19:31 ` bug#74832: [PATCH] guix: Do not default to 22 ssh port (let guile-ssh do it) Tomas Volf
2024-12-19  2:33   ` bug#74832: guix copy incorrectly assumes port is 22 Maxim Cournoyer
2024-12-19  9:30     ` Tomas Volf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734ik6mv4.fsf@wolfsden.cz \
    --to=~@wolfsden.cz \
    --cc=74832@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).