Commit Graph

962 Commits

Author SHA1 Message Date
Cassondra Foesch f4a91c3e08 encoding: test Attributes, consistent test permissions value 2021-03-19 15:39:24 +00:00
Cassondra Foesch 051d8eb669 encoding: fix inconsistency, separate generic packet field encoding from argument encoding 2021-03-19 14:37:06 +00:00
Cassondra Foesch 9ac5730115 encoding: Lstat Setstat Remove Mkdir Rmdir Realpath Stat Rename Readlink Symlink 2021-03-19 14:28:55 +00:00
Cassondra Foesch 65072e271f encoding: oops fix inconsistencies 2021-03-19 13:55:25 +00:00
Cassondra Foesch e31579377f encoding: tests: switch wanted byte slice to use actual value rather than name 2021-03-19 13:48:05 +00:00
Cassondra Foesch 41ee63f7e4 encoding: open_packet → open_packets ahead of Opendir 2021-03-19 12:34:56 +00:00
Cassondra Foesch 261431ecd7 encoding: Opendir 2021-03-18 19:26:55 +00:00
Cassondra Foesch f40e0a88ef encoding: Close Read Write Fstat Fsetstat Readdir 2021-03-18 19:20:28 +00:00
Cassondra Foesch 0daa57a289 encoding: move RequestID unmarshalling into UnmarshalBinary from UnmarshalPacketBody 2021-03-18 18:33:20 +00:00
Cassondra Foesch fae73f87ef document where Link/Block/Unblock come from 2021-03-18 18:24:05 +00:00
Cassondra Foesch e04f1c6d8c encoding: don't accumulate packet length size, just use the length at the end 2021-03-18 18:22:44 +00:00
Cassondra Foesch b397b70d00 encoding: OpenPacket, Attributes, ExtendedAttribute 2021-03-18 17:36:08 +00:00
Cassondra Foesch 3b0e4a5065 encoding: InitPacket and VersionPacket 2021-03-18 17:33:05 +00:00
Cassondra Foesch 08fd102d76 encoding: raw packets 2021-03-18 17:33:00 +00:00
Cassondra Foesch a150663d5e encoding: ExtensionPair 2021-03-18 17:30:35 +00:00
Cassondra Foesch 1d8c49ac6a encoding: Buffer, the workhorse of encoding/decoding 2021-03-18 17:01:58 +00:00
Cassondra Foesch d634c3be59 encoding: import constants 2021-03-18 16:59:27 +00:00
Cassondra Foesch addaabd30b give the bytes.Buffer a preallocated slice to use for less variance 2021-03-17 20:18:50 +00:00
Cassondra Foesch 91163e4463 errors.Errorf over fmt.Errorf 2021-03-17 20:17:55 +00:00
Cassondra Foesch 32f98f3047 split benchmark and benchmark_w_memprofile, include memprofile files to gitignore 2021-03-17 20:17:15 +00:00
Cassondra Foesch c6518c34c4
Merge pull request #420 from greatroar/chmod-setfstat
Implement File.Chmod via setfstat
2021-03-17 17:56:06 +00:00
greatroar 846e27dc7f Implement File.Chmod via setfstat 2021-03-17 18:50:51 +01:00
Cassondra Foesch 325cdac782 Add convenient benchmark Makefile rule 2021-03-17 14:57:00 +00:00
Cassondra Foesch b22b9e472e remove writeToBuffer, the bytes.Buffer.Grow I saw in the memprofile was elsewhere 2021-03-17 13:18:17 +00:00
Cassondra Foesch 39e1161d12 address my own code review comments 2021-03-17 12:05:00 +00:00
Cassondra Foesch f1e28f8a88 Improve benchmarks and errors 2021-03-17 11:03:51 +00:00
Cassondra Foesch 460ad57385
Merge pull request #416 from greatroar/match-cleanup
Clean up matching/globbing code
2021-03-16 01:20:24 +00:00
greatroar d3695c2587 Fix Glob handling of backslashes
\m\a\t\c\h\.\g\o would be interpreted as a literal path, because the
backslash was missing in the check.
2021-03-15 18:11:02 +01:00
greatroar 413dd37571 Clean up matching/globbing code
getEsc, scanChunk and matchChunk were unused leftovers from the old
implementation, removed in 4f3e725e88.

isPathSeparator contained a useless cast to string.

The documentation (copied from path/filepath) referred to a Separator
constant, which is not present in the package.

Join, Split and Match are now explicitly marked as aliases for standard
library functions and refer to stdlib docs for details.
2021-03-15 18:10:43 +01:00
greatroar 053574d9eb Fix panic when connection dropped in the middle of the sid 2021-03-15 18:01:38 +01:00
Cassondra Foesch 6181f5c673
Merge pull request #414 from greatroar/chmod-bits
Support os.Mode{Setuid,Setgid,Sticky} in Chmod
2021-03-15 09:58:20 +00:00
Cassondra Foesch 6c0c9a9e85
Merge pull request #417 from pkg/a-better-buffer-pool
A simpler bytes buffer pool
2021-03-15 09:51:10 +00:00
greatroar 2573693ec5 Support os.Mode{Setuid,Setgid,Sticky} in Chmod
Previously, these bits were ignored by Chmod, which sent the numerical
value of the mode argument as-is to the server. As a result, callers had
to supply POSIX values for setuid, setgid and sticky to Chmod.

The new version supports both the POSIX values and the Go values.

Also added a note to the docs to clarify that the umask is not
subtracted from the mode, and why that is. The only portable way to get
the umask is to set it, then reset it, but that's racy. On Linux, we
could parse /proc/self/status, but that doesn't work portably and will
fail where /proc is not available (some Docker containers, notably).
2021-03-12 16:17:56 +01:00
Cassondra Foesch c34ea374a2 A simpler bytes buffer pool 2021-03-12 15:14:27 +00:00
Nicola Murino e164c76a12
Merge pull request #413 from greatroar/mkdirall-slash
Check for '/', not os.IsPathSeparator, in MkdirAll
2021-03-11 21:39:17 +01:00
Nicola Murino df861a8348
Merge pull request #411 from drakkan/fuzz
client fix potential crash if we receive a short packet
2021-03-11 21:38:59 +01:00
Nicola Murino 25e9e632b3 client: add a test case for init packet too short 2021-03-11 19:56:45 +01:00
greatroar 9bd6912a11 Check for '/', not os.IsPathSeparator, in MkdirAll
The SFTP protocol uses '/' as the path separator, always.
2021-03-11 00:22:17 +01:00
Nicola Murino 23462f6cd7 client fix potential crash if we receive a short packet 2021-03-10 12:26:09 +01:00
Nicola Murino 5b7da38a9c
Merge pull request #410 from pkg/export-realpath
Export RealPath for potential client use
2021-03-06 12:44:23 +01:00
Cassondra Foesch 714bd5db80 +godoc 2021-03-06 09:03:37 +00:00
Cassondra Foesch b83052b538 Export RealPath for potential client use 2021-03-06 08:48:23 +00:00
Nicola Murino f50ad19e9f
Merge pull request #408 from drakkan/345
add an option to disable concurrent reads
2021-03-05 22:37:51 +01:00
Nicola Murino c539fdb9b4 improve readAtSequential as for review 2021-03-05 17:10:39 +01:00
Nicola Murino e1e59da6e3 add readAtSequential: used if concurrent reads are disabled ...
... and the requested buffer is bigger than maxPacket
2021-03-05 15:04:17 +01:00
Nicola Murino 5f2c008b8e add an option to disable concurrent reads
Fixs #345
2021-02-23 19:13:26 +01:00
Nicola Murino a88961882e remove some redundant types 2021-02-22 22:29:35 +01:00
Nicola Murino 696db1cc39 CI: add Go 1.16 and remove 1.14 2021-02-22 16:33:20 +01:00
Nicola Murino b8102da57e
Merge pull request #397 from pkg/more-optimization
More optimization
2021-02-22 16:23:08 +01:00
Cassondra Foesch 861a8eaf5c pointer receivers and statusFromError(uint32, error) 2021-02-22 12:11:42 +00:00