mirror of
https://github.com/fhmq/hmq.git
synced 2026-09-01 23:34:52 +00:00
Plugins support (#46)
* modify * update * add acl * add feature * update dockerfile * add deploy * update * update * plugins * plugins * update * update * update * fixed * remove * fixed * add log * update * fixed * update * fix config * add http api * add http api * resp * add config for work chan * update * fixed * update * disable trace * fixed * change acl * fixed * fixed res * dd * dd * ddd * dd * update * fixed * update * add * fixed * update key * add log * update * format * update * update auth * update * update readme * added * update * fixed * fixed * fix * upade * update * update
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
package pac
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"gopkg.in/jcmturner/rpc.v1/mstypes"
|
||||
)
|
||||
|
||||
// ClientInfo implements https://msdn.microsoft.com/en-us/library/cc237951.aspx
|
||||
type ClientInfo struct {
|
||||
ClientID mstypes.FileTime // A FILETIME structure in little-endian format that contains the Kerberos initial ticket-granting ticket TGT authentication time
|
||||
NameLength uint16 // An unsigned 16-bit integer in little-endian format that specifies the length, in bytes, of the Name field.
|
||||
Name string // An array of 16-bit Unicode characters in little-endian format that contains the client's account name.
|
||||
}
|
||||
|
||||
// Unmarshal bytes into the ClientInfo struct
|
||||
func (k *ClientInfo) Unmarshal(b []byte) (err error) {
|
||||
//The PAC_CLIENT_INFO structure is a simple structure that is not NDR-encoded.
|
||||
r := mstypes.NewReader(bytes.NewReader(b))
|
||||
|
||||
k.ClientID, err = r.FileTime()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
k.NameLength, err = r.Uint16()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
k.Name, err = r.UTF16String(int(k.NameLength))
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user