forked from hirochachacha/go-smb2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smb2.go
40 lines (34 loc) · 1.03 KB
/
smb2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Package smb2 implements the SMB2/3 client in [MS-SMB2].
//
// https://msdn.microsoft.com/en-us/library/cc246482.aspx
//
// This package doesn't support CAP_UNIX extension.
// Symlink is supported by FSCTL_SET_REPARSE_POINT and FSCTL_GET_REPARSE_POINT.
// The symlink-following algorithm is explained in 2.2.2.2.1 and 2.2.2.2.1.1.
//
// https://msdn.microsoft.com/en-us/library/cc246542.aspx
//
// Path restrictions:
// You cannot use slash as a separator, use backslash instead.
// You cannot use leading backslash in pathname. (except mount path and symlink target)
//
// Supported features and protocol versions are declared in feature.go.
package smb2
import (
"encoding/binary"
"io/ioutil"
"log"
"os"
)
const logging = false // for debugging
// const logging = true // for debugging
var zero [16]byte
var be = binary.BigEndian
var logger *log.Logger
func init() {
if logging {
logger = log.New(os.Stderr, "smb2: ", log.Llongfile|log.LstdFlags)
} else {
logger = log.New(ioutil.Discard, "smb2: ", log.Llongfile|log.LstdFlags)
}
}