From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oD+6Ew8Qk2BZUAEAgWs5BA (envelope-from ) for ; Wed, 05 May 2021 23:37:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kKvEDg8Qk2BJVAAAbx9fmQ (envelope-from ) for ; Wed, 05 May 2021 21:37:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9D0B0113C7 for ; Wed, 5 May 2021 23:37:18 +0200 (CEST) Received: from localhost ([::1]:37086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lePCm-0007sn-Tu for larch@yhetil.org; Wed, 05 May 2021 17:37:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leP8i-0002HX-K7 for bug-guix@gnu.org; Wed, 05 May 2021 17:33:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51315) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leP8h-0008MS-Kx for bug-guix@gnu.org; Wed, 05 May 2021 17:33:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1leP8h-0004rJ-Is for bug-guix@gnu.org; Wed, 05 May 2021 17:33:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48240: [PATCH 4/4] ssh: Honor GUIX_DAEMON_SOCKET on the target machine. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 05 May 2021 21:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48240 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 48240@debbugs.gnu.org Received: via spool by 48240-submit@debbugs.gnu.org id=B48240.162025034718643 (code B ref 48240); Wed, 05 May 2021 21:33:03 +0000 Received: (at 48240) by debbugs.gnu.org; 5 May 2021 21:32:27 +0000 Received: from localhost ([127.0.0.1]:34622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leP86-0004qY-Pi for submit@debbugs.gnu.org; Wed, 05 May 2021 17:32:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leP84-0004pw-0u for 48240@debbugs.gnu.org; Wed, 05 May 2021 17:32:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33916) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leP7x-0007ru-St; Wed, 05 May 2021 17:32:18 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=56410 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1leP7x-0005m1-Le; Wed, 05 May 2021 17:32:17 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 5 May 2021 23:32:05 +0200 Message-Id: <20210505213205.28519-4-ludo@gnu.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210505213205.28519-1-ludo@gnu.org> References: <87a6p9rwu7.fsf@elephly.net> <20210505213205.28519-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620250638; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=qyUf1RPKC7VflKrCHgd5QWJZ4vE0qK7Lorle43AowUk=; b=E91OhjBnXyj37TdlDQBtVX+wQGMGrSBizoePQ0qiOTXgzp59+IiHo7ht6vlYQDf+26xMLP s1A3dka0DoK0jxUBe5dT3ejjqm8HUVlAIjF4MQkXemTbZ4diJJNv/NaVZ9A+pOw6aVAMMY aPQKrjJOj/jDUE6Tovuf80O2tK7KQ3+fQweeX/1S3EgEl6HMtPOL7aZwdHPGxHAH53G0wM p0kCXl8rISXznvDM/GNeFBnkSVOPLCvkPDrRolqpslD/ihYW2BwS0EGdPANOK5/NJUy5yD GI1JJBC2UDVS7CuXT3jpDLvikF6WNCsYdL8fNohVNLS/U6MYcjfYovrhnGQ1PA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620250638; a=rsa-sha256; cv=none; b=izMh8dYLgVRbzSQ9SHxDwobH+NxOFS3xSHbJcFqUxWt195olMlLhNxebkt1tVi2lBVsSNQ x5vWp54UGWTgHsvYOyVERjGpD/HX1HUmO7c5BFp9kXXPDfLrYn6UpGCgOq2OTC1bDL6Neg Xo3tQ++PQYLrI7kZw0nZwrAptCKe1QY4BpMtL8tQJB6QR1UVNt3/OHP8DTK6EeJe+1dKCy iPCK3JESKPwHhyKARqHNN/T2CW5JJmYixKc+4YxX1EtoXZSM3gXx11sFXZ5SB+4wLA46Gk RW7JWT5S4QK5y0+bnxBvogpevOfswREMBOpxC6zK/zGYkN6MwK0jYH2YXzUjOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.97 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 9D0B0113C7 X-Spam-Score: -1.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: hmzLlT4kyz65 Fixes . Reported by Ricardo Wurmus . * guix/ssh.scm (remote-daemon-channel)[redirect]: Define 'connect-to-daemon'. Use the same-named procedure from (guix store) when available, and honor GUIX_DAEMON_SOCKET. --- guix/ssh.scm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/guix/ssh.scm b/guix/ssh.scm index b39b90f733..77a9732ce5 100644 --- a/guix/ssh.scm +++ b/guix/ssh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -253,7 +253,22 @@ EXP never returns or calls 'primitive-exit' when it's done." (use-modules (ice-9 match) (rnrs io ports) (rnrs bytevectors)) - (let ((sock (socket AF_UNIX SOCK_STREAM 0)) + (define connect-to-daemon + ;; XXX: 'connect-to-daemon' used to be private and before that it + ;; didn't even exist, hence these shenanigans. + (let ((connect-to-daemon + (false-if-exception (module-ref (resolve-module '(guix store)) + 'connect-to-daemon)))) + (lambda (uri) + (if connect-to-daemon + (connect-to-daemon uri) + (let ((sock (socket AF_UNIX SOCK_STREAM 0))) + (connect sock AF_UNIX ,socket-name) + sock))))) + + ;; Use 'connect-to-daemon' to honor GUIX_DAEMON_SOCKET. + (let ((sock (connect-to-daemon (or (getenv "GUIX_DAEMON_SOCKET") + socket-name))) (stdin (current-input-port)) (stdout (current-output-port)) (select* (lambda (read write except) @@ -272,8 +287,6 @@ EXP never returns or calls 'primitive-exit' when it's done." (setvbuf stdin 'block 65536) (setvbuf sock 'block 65536) - (connect sock AF_UNIX ,socket-name) - (let loop () (match (select* (list stdin sock) '() '()) ((reads () ()) -- 2.31.1