ancilliary breaks

This commit is contained in:
Cassondra Foesch 2024-11-13 21:31:18 +00:00
parent f7eb322f65
commit d2cb4df84e
5 changed files with 9 additions and 12 deletions

View File

@ -12,10 +12,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, macos-latest]
go: ['1.23', '1.22'] go: ['1.23']
exclude:
- os: macos-latest
go: '1.22'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@ -1217,7 +1217,7 @@ const (
OpenFlagReadOnly = os.O_RDONLY OpenFlagReadOnly = os.O_RDONLY
OpenFlagWriteOnly = os.O_WRONLY OpenFlagWriteOnly = os.O_WRONLY
OpenFlagReadWrite = os.O_RDWR OpenFlagReadWrite = os.O_RDWR
// The remaining values may be ored in to control behavior. // The remaining values may be or'ed in to control behavior.
OpenFlagAppend = os.O_APPEND OpenFlagAppend = os.O_APPEND
OpenFlagCreate = os.O_CREATE OpenFlagCreate = os.O_CREATE
OpenFlagTruncate = os.O_TRUNC OpenFlagTruncate = os.O_TRUNC
@ -1552,7 +1552,7 @@ func (f *File) writeat(ctx context.Context, b []byte, off int64) (written int, e
return int(written), f.wrapErr("writeat", firstErr.err) return int(written), f.wrapErr("writeat", firstErr.err)
} }
// We didnt hit any errors, so we must have written all the bytes in the buffer. // We didn't hit any errors, so we must have written all the bytes in the buffer.
written = len(b) written = len(b)
f.offset += int64(written) f.offset += int64(written)
@ -1792,7 +1792,7 @@ func (f *File) ReadFrom(r io.Reader) (read int64, err error) {
return read, f.wrapErr("readfrom", firstErr.err) return read, f.wrapErr("readfrom", firstErr.err)
} }
// We didnt hit any errors, so we must have written all the bytes that we read until EOF. // We didn't hit any errors, so we must have written all the bytes that we read until EOF.
f.offset += read f.offset += read
return read, nil return read, nil
} }

View File

@ -18,7 +18,7 @@ func translateErrorString(errno syscall.ErrorString) sshfx.Status {
case syscall.EACCES, syscall.EPERM: case syscall.EACCES, syscall.EPERM:
return sshfx.StatusPermissionDenied return sshfx.StatusPermissionDenied
case syscall.EPLAN9: case syscall.EPLAN9:
return sshfx.StatusOPUnsupported return sshfx.StatusOpUnsupported
} }
return sshfx.StatusFailure return sshfx.StatusFailure

View File

@ -7,10 +7,10 @@ import (
"github.com/pkg/sftp/v2/encoding/ssh/filexfer/openssh" "github.com/pkg/sftp/v2/encoding/ssh/filexfer/openssh"
) )
// StatVFS stubs the OpenSSH StatVFS with an sshfx.StatusOPUnsupported Status. // StatVFS stubs the OpenSSH StatVFS with an sshfx.StatusOpUnsupported Status.
func StatVFS(name string) (*openssh.StatVFSExtendedReplyPacket, error) { func StatVFS(name string) (*openssh.StatVFSExtendedReplyPacket, error) {
return nil, &sshfx.StatusPacket{ return nil, &sshfx.StatusPacket{
StatusCode: sshfx.StatusOPUnsupported, StatusCode: sshfx.StatusOpUnsupported,
ErrorMessage: syscall.EPLAN9.Error(), ErrorMessage: syscall.EPLAN9.Error(),
} }
} }

View File

@ -10,10 +10,10 @@ import (
"github.com/pkg/sftp/v2/encoding/ssh/filexfer/openssh" "github.com/pkg/sftp/v2/encoding/ssh/filexfer/openssh"
) )
// StatVFS stubs the OpenSSH StatVFS with an sshfx.StatusOPUnsupported Status. // StatVFS stubs the OpenSSH StatVFS with an sshfx.StatusOpUnsupported Status.
func StatVFS(name string) (*openssh.StatVFSExtendedReplyPacket, error) { func StatVFS(name string) (*openssh.StatVFSExtendedReplyPacket, error) {
return nil, &sshfx.StatusPacket{ return nil, &sshfx.StatusPacket{
StatusCode: sshfx.StatusOPUnsupported, StatusCode: sshfx.StatusOpUnsupported,
ErrorMessage: "not supported by " + runtime.GOOS, ErrorMessage: "not supported by " + runtime.GOOS,
} }
} }