From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 22 23:11:57 2024 Received: (at submit) by debbugs.gnu.org; 23 Jul 2024 03:11:57 +0000 Received: from localhost ([127.0.0.1]:58867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sW5wT-0007ms-1o for submit@debbugs.gnu.org; Mon, 22 Jul 2024 23:11:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:43322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sW5wQ-0007mk-R8 for submit@debbugs.gnu.org; Mon, 22 Jul 2024 23:11:55 -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 ) id 1sW5wM-0007FM-MJ for bug-guix@gnu.org; Mon, 22 Jul 2024 23:11:50 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sW5wJ-00061B-U4 for bug-guix@gnu.org; Mon, 22 Jul 2024 23:11:50 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 2AFDB11401C5 for ; Mon, 22 Jul 2024 23:11:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 22 Jul 2024 23:11:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1721704305; x=1721790705; bh=1B9I0fJSLP BjnYWn28xK1Dj4/OEtsqDWxR+cPaZ1D0g=; b=oroLO9S2zY/5UedHBE42fkmDa/ PuwsySVypzJXWx0qeBcc0HIQdqoKyBKQ0qgpe/3Qf53go2tiZ/HASpbymAd6/KKS hQJ5Ufi5IqNB+WeuOhxo/do/s/SCf8nXZwTQ3qpNyArUKR7hUVfieac581Qyp8XF jUmvD/1FXSsrCEp3vpY4O0tEQ2HoI6ceUeqSsX6J3GF0BsbHt4zQxk2qY9Y3XqBL HLXWaFe5rBmexfRUnis0LTfHQH2pGTZm7Pld9SQ63ccoQLGKPJjbjuv0UisPl51a 0BqA4bmUfOD7PGroojJ72NEMO8mjy/JROvUTqk2s6KDZOtlXxtY7qcDhTgtA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1721704305; x=1721790705; bh=1B9I0fJSLPBjnYWn28xK1Dj4/OEt sqDWxR+cPaZ1D0g=; b=ka92SNoPlkW1VxEGFQQP980LJc7zNlwtcxPU+dGugyOh 35kTzYSqHN0DDc5gMxdQmZ0guwmqiOgC1spGhHNTZJlE5JfYm7baHh/ePX80Pxvn zyRjltYwZYwhXXDW85Uq82k8b8+FAqbdt1pvX+KpjFPSRG6rj8yxcYkzb9taSh7p 4O4ksmXgnd4Zi7XfDPiSBc+3MyGdX9IFhvo5LrQIhnDOq3F8Opf0rUx2itl7aZMw rsqZJ2ifaOwBCLGsY1U3kYZXBqSECMSuq0EuB/DVxGm0UMCJAZg8mJxYsnZktn2h PrhGXj64suyc2HhoBlJMZpSURJkIZViRuqOhRUseng== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheekgdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfgfhvffufffkgggtgfesthhqredttd erjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdrthhv qeenucggtffrrghtthgvrhhnpeekieeggeffhfelhffgieffveejjeehvdejffeiieefie etleevudeuleejheehjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehirghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghrtghpthhtoheptd X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 22 Jul 2024 23:11:44 -0400 (EDT) User-agent: mu4e 1.8.13; emacs 28.2 From: Ian Eure To: bug-guix@gnu.org Subject: home-gpg-agent `ssh-support?' breaks SSH agent forwarding Date: Mon, 22 Jul 2024 19:13:44 -0700 Message-ID: <87h6cgu7io.fsf@meson> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=103.168.172.157; envelope-from=ian@retrospec.tv; helo=fhigh6-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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: -2.6 (--) I have a fairly standard agent setup for using a hardware token=20 for SSH and GPG. On my local (Debian, currently) machine, gpg-agent=E2=80=99s configuration= =20 has `enable-ssh-support', and my shell dotfiles set SSH_AUTH_SOCK=20 to the gpg-agent socket, which allows SSH to access the=20 authentication key on my token. Additionally, my SSH config has=20 `ForwardAgent yes', which allows the remote system to talk to the=20 local gpg-agent, enabling things like logging into a remote=20 machine and running `git pull' for repos accessed over SSH. For this to work requires /conditionally/ setting SSH_AUTH_SOCK:=20 on the local host, it needs to be set to the local GPG agent; but=20 on a remote host, it needs to be the forwarded SSH agent. The=20 SSH_AUTH_SOCK variable is set by SSH when setting up the=20 connection, so all that=E2=80=99s needed is to check $SSH_CONNECTION, and=20 leave SSH_AUTH_SOCK untouched -- this is what my shell dotfiles=20 do. Unfortunately, this breaks when logging into a remote system which=20 uses Guix Home=E2=80=99s `home-gpg-agent-service-type'. I initially=20 thought this was an issue converting my homegrown dotfile setup to=20 Guix Home, but after troubleshooting, this appears to be a Guix=20 Home bug. Specifically, the issue is the=20 `home-gpg-agent-environment-variables' procedure in (gnu home=20 services gnupg), which, if `ssh-support?' is enabled in=20 home-gpg-agent-configuration, *unconditionally* sets SSH_AUTH_SOCK=20 to the GPG agent socket. This works for the local host -- I can=20 log into remote systems from a Guix Home machine -- but breaks=20 when SSH=E2=80=99ing to a remote system using Guix Home. I=E2=80=99m not sure how to fix this; home-gpg-agent-environment-variables= =20 returns a list of variables to set, with no facility for=20 conditional logic. Use of bash config files would break for=20 anyone using a different shell -- and how would=20 `home-gpg-agent-service-type' know what shell the user has chosen? If I unset `ssh-support?', it disables both the bad behavior, but=20 also the gpg-agent configuration which enables SSH agent support. Right now, the only thing that seems like it might work is adding=20 another home-environment-variables-service-type which saves the=20 value of SSH_AUTH_SOCK to another variable, which my shell init=20 files can look at later in the process. This feels like a=20 graceless hack (and the base stuff to make this all work already=20 feels overly complex), and would require further hackery for the=20 same dotfiles to work on non-Guix Home systems, which at least=20 some of my configs still do. The other option is to quit using `home-gpg-agent-service-type' at=20 all, and handle all this stuff manually. I don=E2=80=99t love it, but it=20 seems like probably the best option. Thoughts? Thanks, =E2=80=94 Ian