Skip to main content

Module wire

Module wire 

Source
Expand description

SFTP v3 wire format.

Structs§

Attrs
The subset of SSH_FXP_ATTRS the origin layer needs.
Dec
Bounds-checked reader. Every accessor returns None rather than panicking so a malformed reply from the remote cannot take the daemon down.
Enc
Big-endian encoder, chained by value so one request is one expression.

Constants§

ATTRS
CLOSE
DATA
FXF_APPEND
In append mode the offset in each WRITE is ignored and the server places the data at the end. That is what makes a single-writer log safe without any locking.
FXF_CREAT
FXF_READ
FXF_WRITE
HANDLE
INIT
LSTAT
MKDIR
NAME
OPEN
OPENDIR
READ
READDIR
REALPATH
STATUS
STATUS_EOF
A read ending in SSH_FX_EOF is a normal end of file. Any other status is a real failure, and conflating the two turns a directory into an empty 200.
STATUS_NO_SUCH_FILE
SSH_FX_NO_SUCH_FILE: the one refusal that means “there is nothing there” rather than “something went wrong”. Everything else — a permission problem, a dead session, a server that simply failed — has to stay distinguishable from it, because the difference is the difference between an empty answer and an error.
STATUS_OK
SSH_FX_OK, the only status a write may answer with.
VERSION
WRITE

Functions§

owner_of_longname
The owner’s account name out of an SFTP v3 longname, if one can be read with confidence.