From nobody Sat May 4 01:00:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16358654726328.249196144721168; Tue, 2 Nov 2021 08:04:32 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-kRTdUyd5OtK_i17rKeDU9g-1; Tue, 02 Nov 2021 11:04:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78911112B8C1; Tue, 2 Nov 2021 15:04:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BFA679451; Tue, 2 Nov 2021 15:04:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E4FD01806D04; Tue, 2 Nov 2021 15:04:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1A2F2XYN027995 for ; Tue, 2 Nov 2021 11:02:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3E75740CFD11; Tue, 2 Nov 2021 15:02:33 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37B8240CFD10 for ; Tue, 2 Nov 2021 15:02:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88C50800159 for ; Tue, 2 Nov 2021 15:02:31 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-579-197fiASaMcy88VfcH7ZrKw-1; Tue, 02 Nov 2021 11:02:29 -0400 Received: by mail-ed1-f50.google.com with SMTP id f4so18872074edx.12 for ; Tue, 02 Nov 2021 08:02:28 -0700 (PDT) Received: from lokutis.. ([89.205.99.221]) by smtp.gmail.com with ESMTPSA id g12sm4740793edz.68.2021.11.02.08.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 08:02:27 -0700 (PDT) X-MC-Unique: kRTdUyd5OtK_i17rKeDU9g-1 X-MC-Unique: 197fiASaMcy88VfcH7ZrKw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XRFhkF6BjAXK7MyF3JWNokfFlQrxUQ2f5WqbAJ5nc6A=; b=fUyPoQZbkvsUR9ArLnTzKI6Er3DDHEBW7lYFIA7iNX4eotIc8Q8CIc/SaJrBedsipe r9Z8dqEtmWxBKc2zHDLvSpAPBly6Vf25Gj07wGr8hfkP2WbBsaM1XeTOnjW2M/iwAV5i N2izKyQsZyduMtClhKKgGdjNER3E6+NKbdgUZm9qLigtTLdbJNuaT3vevKHJqEV7zdqc bGgqhMI3BBKWgy5HDMYFzieziSEzbP1tbvDNmXquBz7lCE1fufo1YnUmEYSAhzmumu/v DEyoJonkmdlsL4GK2l/QoJBWXeuf5MVfHrIiVWptw5dtpFe2Os/GRl/YP2KicYdq4u+0 PNRQ== X-Gm-Message-State: AOAM5310QDBVKeXRGYOfOLFSh1dp64QxlDCRpwym2/aJyg84ZZqfNrrn QLN6UNMnFMbTuOQgwhdghvBdsPvh2Y0= X-Google-Smtp-Source: ABdhPJyfNOqyshfIKoNMF+s9ohDTiE407tdFxm0j7tEx1aocIB/iI/Iq2rquN1J2mDXG1B274LY3ew== X-Received: by 2002:a05:6402:10da:: with SMTP id p26mr51404833edu.283.1635865347672; Tue, 02 Nov 2021 08:02:27 -0700 (PDT) From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= To: libvir-list@redhat.com Subject: [PATCH] virnetsocket: pass HOME and XDG_RUNTIME_DIR to ssh Date: Tue, 2 Nov 2021 16:01:03 +0100 Message-Id: <20211102150103.35603-1-gdamjan@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 02 Nov 2021 11:04:13 -0400 Cc: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1635865477631100001 openssh supports environment variable expansion in its ssh_config file[1]. These two environment variables can be used to expand paths for ssh sockets and other files. Ex. ``` Host * ControlMaster auto ControlPath ${XDG_RUNTIME_DIR}/ssh-%C.ctl IdentityAgent ${XDG_RUNTIME_DIR}/ssh-agent.socket ``` see also: [1] https://man7.org/linux/man-pages/man5/ssh_config.5.html#ENVIRONMENT_VAR= IABLES [2] https://gitlab.com/libvirt/libvirt/-/issues/232 Signed-off-by: =D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD =D0=93=D0=B5=D0=BE=D1= =80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8 Reviewed-by: Michal Privoznik --- src/rpc/virnetsocket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 943406cd64..76d8519d3a 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -852,6 +852,8 @@ int virNetSocketNewConnectSSH(const char *nodename, =20 cmd =3D virCommandNew(binary ? binary : "ssh"); virCommandAddEnvPassCommon(cmd); + virCommandAddEnvPass(cmd, "HOME"); + virCommandAddEnvPass(cmd, "XDG_RUNTIME_DIR"); virCommandAddEnvPass(cmd, "KRB5CCNAME"); virCommandAddEnvPass(cmd, "SSH_AUTH_SOCK"); virCommandAddEnvPass(cmd, "SSH_ASKPASS"); --=20 2.33.1