Documentation ¶
Overview ¶
Package ctlsock implements the control socket interface that can be activated by passing "-ctlsock" on the command line.
Index ¶
Constants ¶
const ReadBufSize = 5000
ReadBufSize is the size of the request read buffer. The longest possible path is 4096 bytes on Linux and 1024 on Mac OS X so 5000 bytes should be enough to hold the whole JSON request. This assumes that the path does not contain too many characters that had to be be escaped in JSON (for example, a null byte blows up to "\u0000"). We abort the connection if the request is bigger than this.
Variables ¶
This section is empty.
Functions ¶
func SanitizePath ¶
SanitizePath adapts filepath.Clean for FUSE paths.
- Leading slash(es) are dropped
- It returns "" instead of "."
- If the cleaned path points above CWD (start with ".."), an empty string is returned
See the TestSanitizePath testcases for examples.
Types ¶
type Interface ¶
type Interface interface { EncryptPath(string) (string, error) DecryptPath(string) (string, error) }
Interface should be implemented by fusefrontend[_reverse]
type RequestStruct ¶
RequestStruct is sent by a client
type ResponseStruct ¶
type ResponseStruct struct { // Result is the resulting decrypted or encrypted path. Empty on error. Result string // ErrNo is the error number as defined in errno.h. // 0 means success and -1 means that the error number is not known // (look at ErrText in this case). ErrNo int32 // ErrText is a detailed error message. ErrText string // WarnText contains warnings that may have been encountered while // processing the message. WarnText string }
ResponseStruct is sent by us as response to a request