Bug 255892 - sysutils/zfs-stats [patch] facilitate use with ssh
Summary: sysutils/zfs-stats [patch] facilitate use with ssh
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Martin Matuska
Depends on:
Reported: 2021-05-15 03:17 UTC by david
Modified: 2021-06-06 11:55 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (mm)

patch to allow zfs-stats to make use of ssh-agent (516 bytes, patch)
2021-05-15 03:17 UTC, david
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description david 2021-05-15 03:17:41 UTC
Created attachment 224956 [details]
patch to allow zfs-stats to make use of ssh-agent

zfs-stats is a Perl script, and is invoked using /usr/bin/env; it also clears the environment in the process, which is generally a Good Thing.

However, it also clears the SSH_AUTH_SOCK environment variable in the process, which causes each invocation that is intended to use ssh to also request authentication... which rather defeats a lot of the purpose of using (e.g.) public key authentication.

The attached patch causes the script to clear all but the SSH_AUTH_SOCK environment variable; the resulting script thus Just works when told to use ssh.

If there's another (better) way to do this, I'm fine with that.  Having set things up so I only need to enter my authentication information when I login to my laptop, and can then ssh to other machines freely, it seemed a bit ... undesirable ... to suddenly get requests to re-enter the information for each query.

While I was here, I also inserted a "-x" flag in the ssh invocation: zfs-stats certainly has no need to forward X11 for its statistics-gathering.
Comment 1 david 2021-06-06 11:54:48 UTC
After the update of sysutils/zfs-stats from zfs-stats-1.3.0_2 to zfs-stats-1.3.1, I no longer see the reported issue.