diff --git a/pkg/pillar/go.mod b/pkg/pillar/go.mod index 40264b8490b..1e3fd59058b 100644 --- a/pkg/pillar/go.mod +++ b/pkg/pillar/go.mod @@ -33,7 +33,7 @@ require ( github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.5.0 github.com/lf-edge/edge-containers v0.0.0-20260502192833-bdbe764faf59 github.com/lf-edge/eve-api/go v0.0.0-20260812180240-99d02ddcfcb0 - github.com/lf-edge/eve-libs v0.0.0-20260709031003-b4ce2d8fe509 + github.com/lf-edge/eve-libs v0.0.0-20260807152845-882c84170868 github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d github.com/lf-edge/go-qemu v0.0.0-20231121152149-4c467eda0c56 github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20240507172735-6d37353ca1ee diff --git a/pkg/pillar/go.sum b/pkg/pillar/go.sum index de6bee677e3..65f1374e75a 100644 --- a/pkg/pillar/go.sum +++ b/pkg/pillar/go.sum @@ -499,8 +499,8 @@ github.com/lf-edge/edge-containers v0.0.0-20260502192833-bdbe764faf59 h1:fuyDqWU github.com/lf-edge/edge-containers v0.0.0-20260502192833-bdbe764faf59/go.mod h1:DoK51ifLgVh2GQ+IXTvmkhTuf8THijPCwYlNAbs2Nz0= github.com/lf-edge/eve-api/go v0.0.0-20260812180240-99d02ddcfcb0 h1:vFrZPWDaFupy4K1fYIRDJOnW8aaGNMZ1/1DkNRXrZe0= github.com/lf-edge/eve-api/go v0.0.0-20260812180240-99d02ddcfcb0/go.mod h1:6HxNA/qKJVEqwpuOFkcQ0h3QyotvAs/cjHLC961FPOY= -github.com/lf-edge/eve-libs v0.0.0-20260709031003-b4ce2d8fe509 h1:XF4/wbn0YSDxhnafSjfN6/t5AIA9KfOk4VgYsbfXXqI= -github.com/lf-edge/eve-libs v0.0.0-20260709031003-b4ce2d8fe509/go.mod h1:gE8ZZCB1JM7TaXMma0yhLstMfHadLXTIOwVeJq1Jsds= +github.com/lf-edge/eve-libs v0.0.0-20260807152845-882c84170868 h1:hGgskJxVKjCaiPv9zHVjOAe8ye+6HqGzdNUGEWy3n4c= +github.com/lf-edge/eve-libs v0.0.0-20260807152845-882c84170868/go.mod h1:ZwkS/Xlx3klDLUobHesq3dAjiRfUlz0Pk6LxiRnhOck= github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d h1:tUBb9M6u42LXwHAYHyh22wJeUUQlTpDkXwRXalpRqbo= github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d/go.mod h1:Nn3juMJJ1G8dyHOebdZyS4jOB/fuxAd5fIajBaWjHr8= github.com/lf-edge/go-qemu v0.0.0-20231121152149-4c467eda0c56 h1:LmFp0jbNSwPLuxJA+nQ+mMQrQ53ESkvHP4CVMqR0zrY= diff --git a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/sftputil/sftp.go b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/sftputil/sftp.go index e8e8d365306..e90690c3d95 100644 --- a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/sftputil/sftp.go +++ b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/sftputil/sftp.go @@ -8,6 +8,7 @@ import ( "io" "log" "net" + "net/url" "os" "strings" "time" @@ -46,14 +47,31 @@ func getSftpClient(host, user, pass string) (*sftp.Client, error) { Timeout: time.Duration(10) * time.Second, } + // host may be a bare "host:port" (the original contract, still used by + // older EVE versions and potentially callers outside EVE) or a scheme-qualified + // URL such as "sftp://host:port", which newer EVE versions now require + // (since https://github.com/lf-edge/eve/pull/5588). + // url.Parse "succeeds" on a bare host:port too, but only as an opaque URI + // (an empty Host, with the part before the port's colon landing in Scheme/Opaque + // instead), so u.Host is what actually distinguishes the two: non-empty only for a + // real scheme-qualified authority-form URL. + dialAddr := host + if u, err := url.Parse(host); err == nil && u.Host != "" { + dialAddr = u.Host + } + // We break this up into a DNS lookup and a Dial only to be able to detect - // the errors better - args := strings.Split(host, ":") - if _, err := net.LookupHost(args[0]); err != nil { + // the errors better. net.SplitHostPort (rather than a naive split on ":") + // also correctly handles a bracketed IPv6 literal. + hostname, _, err := net.SplitHostPort(dialAddr) + if err != nil { + hostname = dialAddr + } + if _, err := net.LookupHost(hostname); err != nil { log.Printf("LookupHost error: %s", err) return nil, err } - client, err := ssh.Dial("tcp", host, clientConfig) + client, err := ssh.Dial("tcp", dialAddr, clientConfig) if err != nil { return nil, err } diff --git a/pkg/pillar/vendor/modules.txt b/pkg/pillar/vendor/modules.txt index 6be4d515545..8d25b2aeb78 100644 --- a/pkg/pillar/vendor/modules.txt +++ b/pkg/pillar/vendor/modules.txt @@ -883,7 +883,7 @@ github.com/lf-edge/eve-api/go/nestedappinstancemetrics github.com/lf-edge/eve-api/go/profile github.com/lf-edge/eve-api/go/proxy github.com/lf-edge/eve-api/go/register -# github.com/lf-edge/eve-libs v0.0.0-20260709031003-b4ce2d8fe509 +# github.com/lf-edge/eve-libs v0.0.0-20260807152845-882c84170868 ## explicit; go 1.25.0 github.com/lf-edge/eve-libs/depgraph github.com/lf-edge/eve-libs/nettrace