public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] test: Look for possible sshd-session paths (if it's there at all) in mbuto's profile
@ 2024-08-26 18:41 Stefano Brivio
  2024-08-27  0:55 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2024-08-26 18:41 UTC (permalink / raw)
  To: passt-dev; +Cc: David Gibson

Some distributions already have OpenSSH 9.8, which introduces split
sshd/sshd-session binaries, and there we need to copy the binary from
the host, which can be /usr/libexec/openssh/sshd-session (Fedora
Rawhide), /usr/lib/ssh/sshd-session (Arch Linux),
/usr/lib/openssh/sshd-session (Debian), and possibly other paths.

Add at least those three, and, if we don't find sshd-session, assume
we don't need it: it could very well be an older version of OpenSSH,
as reported by David for Fedora 40, or perhaps another daemon (would
Dropbear even work? I'm not sure).

Reported-by: David Gibson <david@gibson.dropbear.id.au>
Fixes: d6817b3930be ("test/passt.mbuto: Install sshd-session OpenSSH's split process")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
 test/passt.mbuto | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/test/passt.mbuto b/test/passt.mbuto
index 61865e8..138d365 100755
--- a/test/passt.mbuto
+++ b/test/passt.mbuto
@@ -13,8 +13,15 @@
 PROGS="${PROGS:-ash,dash,bash ip mount ls insmod mkdir ln cat chmod lsmod
        modprobe find grep mknod mv rm umount jq iperf3 dhclient hostname
        sed tr chown sipcalc cut socat dd strace ping tail killall sleep sysctl
-       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp
-       /usr/lib/openssh/sshd-session}"
+       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp}"
+
+# OpenSSH 9.8 introduced split binaries, with sshd being the daemon, and
+# sshd-session the per-session program. We need the latter as well, and the path
+# depends on the distribution. It doesn't exist on older versions.
+for bin in /usr/lib/openssh/sshd-session /usr/lib/ssh/sshd-session \
+	   /usr/libexec/openssh/sshd-session; do
+	command -v "${bin}" >/dev/null && PROGS="${PROGS} ${bin}"
+done
 
 KMODS="${KMODS:- virtio_net virtio_pci vmw_vsock_virtio_transport}"
 
-- 
@@ -13,8 +13,15 @@
 PROGS="${PROGS:-ash,dash,bash ip mount ls insmod mkdir ln cat chmod lsmod
        modprobe find grep mknod mv rm umount jq iperf3 dhclient hostname
        sed tr chown sipcalc cut socat dd strace ping tail killall sleep sysctl
-       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp
-       /usr/lib/openssh/sshd-session}"
+       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp}"
+
+# OpenSSH 9.8 introduced split binaries, with sshd being the daemon, and
+# sshd-session the per-session program. We need the latter as well, and the path
+# depends on the distribution. It doesn't exist on older versions.
+for bin in /usr/lib/openssh/sshd-session /usr/lib/ssh/sshd-session \
+	   /usr/libexec/openssh/sshd-session; do
+	command -v "${bin}" >/dev/null && PROGS="${PROGS} ${bin}"
+done
 
 KMODS="${KMODS:- virtio_net virtio_pci vmw_vsock_virtio_transport}"
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test: Look for possible sshd-session paths (if it's there at all) in mbuto's profile
  2024-08-26 18:41 [PATCH] test: Look for possible sshd-session paths (if it's there at all) in mbuto's profile Stefano Brivio
@ 2024-08-27  0:55 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2024-08-27  0:55 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: passt-dev

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

On Mon, Aug 26, 2024 at 08:41:31PM +0200, Stefano Brivio wrote:
> Some distributions already have OpenSSH 9.8, which introduces split
> sshd/sshd-session binaries, and there we need to copy the binary from
> the host, which can be /usr/libexec/openssh/sshd-session (Fedora
> Rawhide), /usr/lib/ssh/sshd-session (Arch Linux),
> /usr/lib/openssh/sshd-session (Debian), and possibly other paths.
> 
> Add at least those three, and, if we don't find sshd-session, assume
> we don't need it: it could very well be an older version of OpenSSH,
> as reported by David for Fedora 40, or perhaps another daemon (would
> Dropbear even work? I'm not sure).
> 
> Reported-by: David Gibson <david@gibson.dropbear.id.au>
> Fixes: d6817b3930be ("test/passt.mbuto: Install sshd-session OpenSSH's split process")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  test/passt.mbuto | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/test/passt.mbuto b/test/passt.mbuto
> index 61865e8..138d365 100755
> --- a/test/passt.mbuto
> +++ b/test/passt.mbuto
> @@ -13,8 +13,15 @@
>  PROGS="${PROGS:-ash,dash,bash ip mount ls insmod mkdir ln cat chmod lsmod
>         modprobe find grep mknod mv rm umount jq iperf3 dhclient hostname
>         sed tr chown sipcalc cut socat dd strace ping tail killall sleep sysctl
> -       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp
> -       /usr/lib/openssh/sshd-session}"
> +       nproc tcp_rr tcp_crr udp_rr which tee seq bc sshd ssh-keygen cmp}"
> +
> +# OpenSSH 9.8 introduced split binaries, with sshd being the daemon, and
> +# sshd-session the per-session program. We need the latter as well, and the path
> +# depends on the distribution. It doesn't exist on older versions.
> +for bin in /usr/lib/openssh/sshd-session /usr/lib/ssh/sshd-session \
> +	   /usr/libexec/openssh/sshd-session; do
> +	command -v "${bin}" >/dev/null && PROGS="${PROGS} ${bin}"
> +done
>  
>  KMODS="${KMODS:- virtio_net virtio_pci vmw_vsock_virtio_transport}"
>  

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-27  0:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-26 18:41 [PATCH] test: Look for possible sshd-session paths (if it's there at all) in mbuto's profile Stefano Brivio
2024-08-27  0:55 ` David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).