diff --git a/common/go.mod b/common/go.mod index 676f646112..fb6d3f7de6 100644 --- a/common/go.mod +++ b/common/go.mod @@ -30,7 +30,7 @@ require ( github.com/opencontainers/runtime-spec v1.3.0 github.com/opencontainers/runtime-tools v0.9.1-0.20260316125833-8a4db579f5c8 github.com/opencontainers/selinux v1.15.1 - github.com/pkg/sftp v1.13.10 + github.com/pkg/sftp v1.13.11 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/seccomp/libseccomp-golang v0.11.1 github.com/sirupsen/logrus v1.9.4 diff --git a/common/go.sum b/common/go.sum index 33302f2348..7f0316a2c9 100644 --- a/common/go.sum +++ b/common/go.sum @@ -187,8 +187,8 @@ github.com/opencontainers/runtime-tools v0.9.1-0.20260316125833-8a4db579f5c8 h1: github.com/opencontainers/runtime-tools v0.9.1-0.20260316125833-8a4db579f5c8/go.mod h1:DKDEfzxvRkoQ6n9TGhxQgg2IM1lY4aM0eaQP4e3oElw= github.com/opencontainers/selinux v1.15.1 h1:ERxeh5caJvCzNAKdI8WQbJmB1LDTn4BuaAg8wihLBpA= github.com/opencontainers/selinux v1.15.1/go.mod h1:LenyElirjUHszfxrjuFqC85HIeXZKumHcKMQtnaDlQQ= -github.com/pkg/sftp v1.13.10 h1:+5FbKNTe5Z9aspU88DPIKJ9z2KZoaGCu6Sr6kKR/5mU= -github.com/pkg/sftp v1.13.10/go.mod h1:bJ1a7uDhrX/4OII+agvy28lzRvQrmIQuaHrcI1HbeGA= +github.com/pkg/sftp v1.13.11 h1:0N92SLTB8JqASJB14ZLHHzFnBV8mG9zw4K7jghEFWuE= +github.com/pkg/sftp v1.13.11/go.mod h1:uNkH9roSXglNJqM+glJJi+TQXQUm0fXFWqCFmT8hsN0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/vendor/github.com/pkg/sftp/attrs.go b/vendor/github.com/pkg/sftp/attrs.go index 74ac03b786..c995534e8a 100644 --- a/vendor/github.com/pkg/sftp/attrs.go +++ b/vendor/github.com/pkg/sftp/attrs.go @@ -40,7 +40,7 @@ func (fi *fileInfo) ModTime() time.Time { return fi.stat.ModTime() } // IsDir returns true if the file is a directory. func (fi *fileInfo) IsDir() bool { return fi.Mode().IsDir() } -func (fi *fileInfo) Sys() interface{} { return fi.stat } +func (fi *fileInfo) Sys() any { return fi.stat } // FileStat holds the original unmarshalled values from a call to READDIR or // *STAT. It is exported for the purposes of accessing the raw values via diff --git a/vendor/github.com/pkg/sftp/client.go b/vendor/github.com/pkg/sftp/client.go index 307a35ea5b..c04f1afdff 100644 --- a/vendor/github.com/pkg/sftp/client.go +++ b/vendor/github.com/pkg/sftp/client.go @@ -561,7 +561,7 @@ func (c *Client) Symlink(oldname, newname string) error { } } -func (c *Client) fsetstat(handle string, flags uint32, attrs interface{}) error { +func (c *Client) fsetstat(handle string, flags uint32, attrs any) error { id := c.nextID() typ, data, err := c.sendPacket(context.Background(), nil, &sshFxpFsetstatPacket{ ID: id, @@ -581,7 +581,7 @@ func (c *Client) fsetstat(handle string, flags uint32, attrs interface{}) error } // setstat is a convience wrapper to allow for changing of various parts of the file descriptor. -func (c *Client) setstat(path string, flags uint32, attrs interface{}) error { +func (c *Client) setstat(path string, flags uint32, attrs any) error { id := c.nextID() typ, data, err := c.sendPacket(context.Background(), nil, &sshFxpSetstatPacket{ ID: id, diff --git a/vendor/github.com/pkg/sftp/debug.go b/vendor/github.com/pkg/sftp/debug.go index f0db14d3ac..f14febb87b 100644 --- a/vendor/github.com/pkg/sftp/debug.go +++ b/vendor/github.com/pkg/sftp/debug.go @@ -5,6 +5,6 @@ package sftp import "log" -func debug(fmt string, args ...interface{}) { +func debug(fmt string, args ...any) { log.Printf(fmt, args...) } diff --git a/vendor/github.com/pkg/sftp/packet-manager.go b/vendor/github.com/pkg/sftp/packet-manager.go index 647836ba82..85e148f811 100644 --- a/vendor/github.com/pkg/sftp/packet-manager.go +++ b/vendor/github.com/pkg/sftp/packet-manager.go @@ -62,8 +62,7 @@ type orderedRequest struct { func (s *packetManager) newOrderedRequest(p requestPacket) orderedRequest { return orderedRequest{requestPacket: p, orderid: s.newOrderID()} } -func (p orderedRequest) orderID() uint32 { return p.orderid } -func (p orderedRequest) setOrderID(oid uint32) { p.orderid = oid } +func (p orderedRequest) orderID() uint32 { return p.orderid } type orderedResponse struct { responsePacket @@ -74,8 +73,7 @@ func (s *packetManager) newOrderedResponse(p responsePacket, id uint32, ) orderedResponse { return orderedResponse{responsePacket: p, orderid: id} } -func (p orderedResponse) orderID() uint32 { return p.orderid } -func (p orderedResponse) setOrderID(oid uint32) { p.orderid = oid } +func (p orderedResponse) orderID() uint32 { return p.orderid } type orderedPacket interface { id() uint32 diff --git a/vendor/github.com/pkg/sftp/packet.go b/vendor/github.com/pkg/sftp/packet.go index 3836ab6f20..747128257d 100644 --- a/vendor/github.com/pkg/sftp/packet.go +++ b/vendor/github.com/pkg/sftp/packet.go @@ -95,7 +95,7 @@ func marshalStatus(b []byte, err StatusError) []byte { return b } -func marshal(b []byte, v interface{}) []byte { +func marshal(b []byte, v any) []byte { switch v := v.(type) { case nil: return b @@ -225,6 +225,12 @@ func unmarshalFileStat(flags uint32, b []byte) (*FileStat, []byte, error) { return nil, b, err } + // Each extended attribute occupies at least 8 bytes (two + // length-prefixed strings), so a count larger than len(b)/8 cannot + // fit and is malformed. + if count > uint32(len(b)/8) { + return nil, b, errShortPacket + } ext := make([]StatExtended, count) for i := uint32(0); i < count; i++ { var typ string @@ -690,7 +696,7 @@ func (p *sshFxpRealpathPacket) UnmarshalBinary(b []byte) error { type sshFxpNameAttr struct { Name string LongName string - Attrs []interface{} + Attrs []any } func (p *sshFxpNameAttr) MarshalBinary() ([]byte, error) { @@ -740,7 +746,7 @@ type sshFxpOpenPacket struct { Path string Pflags uint32 Flags uint32 - Attrs interface{} + Attrs any } func (p *sshFxpOpenPacket) id() uint32 { return p.ID } @@ -1006,14 +1012,14 @@ type sshFxpSetstatPacket struct { ID uint32 Flags uint32 Path string - Attrs interface{} + Attrs any } type sshFxpFsetstatPacket struct { ID uint32 Flags uint32 Handle string - Attrs interface{} + Attrs any } func (p *sshFxpSetstatPacket) id() uint32 { return p.ID } diff --git a/vendor/github.com/pkg/sftp/release.go b/vendor/github.com/pkg/sftp/release.go index 9ecedc4410..7cc8a6f6c3 100644 --- a/vendor/github.com/pkg/sftp/release.go +++ b/vendor/github.com/pkg/sftp/release.go @@ -3,4 +3,4 @@ package sftp -func debug(fmt string, args ...interface{}) {} +func debug(fmt string, args ...any) {} diff --git a/vendor/github.com/pkg/sftp/request-example.go b/vendor/github.com/pkg/sftp/request-example.go index f003e7114c..ec0e1a98d1 100644 --- a/vendor/github.com/pkg/sftp/request-example.go +++ b/vendor/github.com/pkg/sftp/request-example.go @@ -573,7 +573,7 @@ func (f *memFile) Mode() os.FileMode { } func (f *memFile) ModTime() time.Time { return f.modtime } func (f *memFile) IsDir() bool { return f.isdir } -func (f *memFile) Sys() interface{} { +func (f *memFile) Sys() any { return fakeFileInfoSys() } diff --git a/vendor/github.com/pkg/sftp/request-plan9.go b/vendor/github.com/pkg/sftp/request-plan9.go index 38f91bcde2..50dc01f8d6 100644 --- a/vendor/github.com/pkg/sftp/request-plan9.go +++ b/vendor/github.com/pkg/sftp/request-plan9.go @@ -7,10 +7,10 @@ import ( "syscall" ) -func fakeFileInfoSys() interface{} { +func fakeFileInfoSys() any { return &syscall.Dir{} } -func testOsSys(sys interface{}) error { +func testOsSys(sys any) error { return nil } diff --git a/vendor/github.com/pkg/sftp/request-unix.go b/vendor/github.com/pkg/sftp/request-unix.go index e3e037d606..b94063dd4e 100644 --- a/vendor/github.com/pkg/sftp/request-unix.go +++ b/vendor/github.com/pkg/sftp/request-unix.go @@ -8,11 +8,11 @@ import ( "syscall" ) -func fakeFileInfoSys() interface{} { +func fakeFileInfoSys() any { return &syscall.Stat_t{Uid: 65534, Gid: 65534} } -func testOsSys(sys interface{}) error { +func testOsSys(sys any) error { fstat := sys.(*FileStat) if fstat.UID != uint32(65534) { return errors.New("Uid failed to match") diff --git a/vendor/github.com/pkg/sftp/request.go b/vendor/github.com/pkg/sftp/request.go index e7c47a9c9b..e01cad7a74 100644 --- a/vendor/github.com/pkg/sftp/request.go +++ b/vendor/github.com/pkg/sftp/request.go @@ -538,7 +538,7 @@ func filelist(h FileLister, r *Request, pkt requestPacket) responsePacket { nameAttrs = append(nameAttrs, &sshFxpNameAttr{ Name: fi.Name(), LongName: runLs(idLookup, fi), - Attrs: []interface{}{fi}, + Attrs: []any{fi}, }) } diff --git a/vendor/github.com/pkg/sftp/request_windows.go b/vendor/github.com/pkg/sftp/request_windows.go index bd1d686457..172a941ef1 100644 --- a/vendor/github.com/pkg/sftp/request_windows.go +++ b/vendor/github.com/pkg/sftp/request_windows.go @@ -4,10 +4,10 @@ import ( "syscall" ) -func fakeFileInfoSys() interface{} { +func fakeFileInfoSys() any { return syscall.Win32FileAttributeData{} } -func testOsSys(sys interface{}) error { +func testOsSys(sys any) error { return nil } diff --git a/vendor/github.com/pkg/sftp/server.go b/vendor/github.com/pkg/sftp/server.go index 7735c42c4e..c50bc414c8 100644 --- a/vendor/github.com/pkg/sftp/server.go +++ b/vendor/github.com/pkg/sftp/server.go @@ -463,7 +463,7 @@ func (p *sshFxpStatResponse) MarshalBinary() ([]byte, error) { return append(header, payload...), err } -var emptyFileStat = []interface{}{uint32(0)} +var emptyFileStat = []any{uint32(0)} func (p *sshFxpOpenPacket) readonly() bool { return !p.hasPflags(sshFxfWrite) @@ -542,7 +542,7 @@ func (p *sshFxpReaddirPacket) respond(svr *Server) responsePacket { ret.NameAttrs = append(ret.NameAttrs, &sshFxpNameAttr{ Name: dirent.Name(), LongName: runLs(idLookup, dirent), - Attrs: []interface{}{dirent}, + Attrs: []any{dirent}, }) } return ret @@ -597,7 +597,7 @@ func (p *sshFxpFsetstatPacket) respond(svr *Server) responsePacket { Chtimes(atime, mtime time.Time) error } - switch f := interface{}(f).(type) { + switch f := any(f).(type) { case chtimer: // future-compatible, for when/if *os.File supports Chtimes. err = f.Chtimes(fs.AccessTime(), fs.ModTime()) diff --git a/vendor/github.com/pkg/sftp/server_windows.go b/vendor/github.com/pkg/sftp/server_windows.go index e940dba101..e146203981 100644 --- a/vendor/github.com/pkg/sftp/server_windows.go +++ b/vendor/github.com/pkg/sftp/server_windows.go @@ -170,7 +170,7 @@ func (w *winRootFileInfo) Size() int64 { return 0 } func (w *winRootFileInfo) Mode() fs.FileMode { return fs.ModeDir | 0555 } // read+execute for all func (w *winRootFileInfo) ModTime() time.Time { return w.modTime } func (w *winRootFileInfo) IsDir() bool { return true } -func (w *winRootFileInfo) Sys() interface{} { return nil } +func (w *winRootFileInfo) Sys() any { return nil } // Create a new root FileInfo var rootFileInfo = &winRootFileInfo{ diff --git a/vendor/modules.txt b/vendor/modules.txt index 155cf15006..54f88d85dc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -367,8 +367,8 @@ github.com/opencontainers/selinux/pkg/pwalkdir # github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c ## explicit; go 1.14 github.com/pkg/browser -# github.com/pkg/sftp v1.13.10 -## explicit; go 1.23.0 +# github.com/pkg/sftp v1.13.11 +## explicit; go 1.25.0 github.com/pkg/sftp github.com/pkg/sftp/internal/encoding/ssh/filexfer github.com/pkg/sftp/internal/encoding/ssh/filexfer/openssh