From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 04 23:58:55 2018 Received: (at submit) by debbugs.gnu.org; 5 Nov 2018 04:58:55 +0000 Received: from localhost ([127.0.0.1]:34501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJWyU-00030Z-SJ for submit@debbugs.gnu.org; Sun, 04 Nov 2018 23:58:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJWyS-00030K-I2 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 23:58:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJWyK-0007UF-Tx for submit@debbugs.gnu.org; Sun, 04 Nov 2018 23:58:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJWyK-0007Tz-PL for submit@debbugs.gnu.org; Sun, 04 Nov 2018 23:58:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJWyI-0003hw-Gl for bug-guix@gnu.org; Sun, 04 Nov 2018 23:58:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJWyC-0007HL-Sa for bug-guix@gnu.org; Sun, 04 Nov 2018 23:58:40 -0500 Received: from mail-it1-x135.google.com ([2607:f8b0:4864:20::135]:34312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJWyB-00075b-1d for bug-guix@gnu.org; Sun, 04 Nov 2018 23:58:36 -0500 Received: by mail-it1-x135.google.com with SMTP id t189-v6so6752768itf.1 for ; Sun, 04 Nov 2018 20:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=9W2vp8oRn8gd4+ADQZz2qHRH+MCm2vWp5d92eX7AmRY=; b=ijFqi2x5RyPojg1hvRXhZbZKaFUeJj9yEJxQtc1lniYKfGvzgznHT2fEe9iFi6u6M7 FqzgUlf/0niuimmhqHHeetBXNmQ+BERKHhjPhJKasT3wa5c+8l/uJYHEh+cdJpkxccNd enmZ0gyX9jDCf2WVW3WDiusthPlkNrqeu1YM84wB4rTeWpEwqqT10B/ggA5vx6fOolny 3PeX5AtXEFWowcj4XTRjvjXP3IT3ZbvOfa1WsDzs/TQ4MmCzH+tZFxl7hdb2HpSJ6Oyb qXKbccQrbcDg0y4Fw9qYambSSFuB8BEw++kB4w8zitZ+zj8swgeB3IupZ3P6zPeRc1wh YKxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=9W2vp8oRn8gd4+ADQZz2qHRH+MCm2vWp5d92eX7AmRY=; b=e+9T5JT2M1dm3qg8q7es6nWdf+AGN64/UmaK58LQaR6pEHjq3LTHNjCj257ARk+7m+ iNGkOpdoFJKMq1bN0n5wb4lEVZ5nyOu10gdyuhzVhB8JwQF2QAFQbVyGKE5Ehocka1p9 32VmGQXgcr2jt3oOWZryySwLyA17HKwt31eW2veCTwbYG0sWUcaUd0v4PBCukifdm1dU h2UHPdzsoSy5VyKVdWffFh8jauIoaj/VXtHavDTWvfLpVm0d6qoJnNMGCez3tTgdohkp wvHa+a0BHIe9AUwbb445WtYQFsa1Tx2Mj1HJha3JsuLDbCDPriWlHSLpnQ3ZqOZIuoSr 6aiw== X-Gm-Message-State: AGRZ1gLUXOdsHgP/qWx3tW4l3XxArkJyBF4sgwgVIHGxqPwAAol1As2n eojsdQXmd2QsHfbwBQU6A34mW+i0 X-Google-Smtp-Source: AJdET5eq++0eJgzAJlbwrYW1aXvvMm52qtwVsUPprgQPB6lxnWK+fs5+fLGgwF0ox58Gxgp//Xt04w== X-Received: by 2002:a24:7b11:: with SMTP id q17-v6mr5542811itc.80.1541393910333; Sun, 04 Nov 2018 20:58:30 -0800 (PST) Received: from apteryx (76-10-140-126.dsl.teksavvy.com. [76.10.140.126]) by smtp.gmail.com with ESMTPSA id q131-v6sm3333366itb.5.2018.11.04.20.58.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Nov 2018 20:58:29 -0800 (PST) From: Maxim Cournoyer To: bug-guix Subject: guix-copy: Honor the SSH port of a host when defined in ~/.ssh/config Date: Sun, 04 Nov 2018 23:58:27 -0500 Message-ID: <87a7mo5de4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain Hello, I recently stumbled on the bug where guix copy would the port 22 even when I had specified a different one in my ~/.ssh/config file. This bug is triggered when omitting the port in the --to= (or --from) expression, such as in guix copy --to=somehost bash And where somehost exists in ~/.ssh/config, say: Host somehost User someuser HostName someplace.somedns.net Port 1234 Instead of using port 1234, the port 22 would be used. Commit cc1dfc202f is the reason of this overriding; the attached patch reverts it, with a detailed explanation. Thank you, Maxim --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-copy-Default-to-port-22.patch From 942eb8cabef5b7c8b4425c765b6ee2ac9f529ad8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 4 Nov 2018 23:35:16 -0500 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. --- guix/scripts/copy.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/guix/scripts/copy.scm b/guix/scripts/copy.scm index 4c8592985..d35eed74e 100644 --- a/guix/scripts/copy.scm +++ b/guix/scripts/copy.scm @@ -75,8 +75,7 @@ package names, build the underlying packages before sending them." (and (or (assoc-ref opts 'dry-run?) (build-derivations local drv)) - (let* ((session (open-ssh-session host #:user user - #:port (or port 22))) + (let* ((session (open-ssh-session host #:user user #:port port)) (sent (send-files local items (connect-to-remote-daemon session) #:recursive? #t))) @@ -89,7 +88,7 @@ package names, build the underlying packages before sending them." (let*-values (((user host port) (ssh-spec->user+host+port source)) ((session) - (open-ssh-session host #:user user #:port (or port 22))) + (open-ssh-session host #:user user #:port port)) ((remote) (connect-to-remote-daemon session))) (set-build-options-from-command-line local opts) -- 2.19.0 --=-=-=--