mirror of https://github.com/pkg/sftp.git
ancilliary breaks
This commit is contained in:
parent
f7eb322f65
commit
d2cb4df84e
|
@ -12,10 +12,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
go: ['1.23', '1.22']
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
go: '1.22'
|
||||
go: ['1.23']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
@ -1217,7 +1217,7 @@ const (
|
|||
OpenFlagReadOnly = os.O_RDONLY
|
||||
OpenFlagWriteOnly = os.O_WRONLY
|
||||
OpenFlagReadWrite = os.O_RDWR
|
||||
// The remaining values may be or’ed in to control behavior.
|
||||
// The remaining values may be or'ed in to control behavior.
|
||||
OpenFlagAppend = os.O_APPEND
|
||||
OpenFlagCreate = os.O_CREATE
|
||||
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)
|
||||
}
|
||||
|
||||
// We didn’t 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)
|
||||
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)
|
||||
}
|
||||
|
||||
// We didn’t 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
|
||||
return read, nil
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func translateErrorString(errno syscall.ErrorString) sshfx.Status {
|
|||
case syscall.EACCES, syscall.EPERM:
|
||||
return sshfx.StatusPermissionDenied
|
||||
case syscall.EPLAN9:
|
||||
return sshfx.StatusOPUnsupported
|
||||
return sshfx.StatusOpUnsupported
|
||||
}
|
||||
|
||||
return sshfx.StatusFailure
|
||||
|
|
|
@ -7,10 +7,10 @@ import (
|
|||
"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) {
|
||||
return nil, &sshfx.StatusPacket{
|
||||
StatusCode: sshfx.StatusOPUnsupported,
|
||||
StatusCode: sshfx.StatusOpUnsupported,
|
||||
ErrorMessage: syscall.EPLAN9.Error(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,10 +10,10 @@ import (
|
|||
"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) {
|
||||
return nil, &sshfx.StatusPacket{
|
||||
StatusCode: sshfx.StatusOPUnsupported,
|
||||
StatusCode: sshfx.StatusOpUnsupported,
|
||||
ErrorMessage: "not supported by " + runtime.GOOS,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue