| 1 |
package mstypes |
| 2 |
|
| 3 |
import ( |
| 4 |
"encoding/binary" |
| 5 |
|
| 6 |
"gopkg.in/jcmturner/rpc.v0/ndr" |
| 7 |
) |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
const ( |
| 12 |
SEGroupMandatory = 31 |
| 13 |
SEGroupEnabledByDefault = 30 |
| 14 |
SEGroupEnabled = 29 |
| 15 |
SEGroupOwner = 28 |
| 16 |
SEGroupResource = 2 |
| 17 |
|
| 18 |
) |
| 19 |
|
| 20 |
|
| 21 |
type KerbSidAndAttributes struct { |
| 22 |
SID RPCSID |
| 23 |
Attributes uint32 |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
func ReadKerbSidAndAttributes(b *[]byte, p *int, e *binary.ByteOrder) (KerbSidAndAttributes, error) { |
| 28 |
s, err := ReadRPCSID(b, p, e) |
| 29 |
if err != nil { |
| 30 |
return KerbSidAndAttributes{}, err |
| 31 |
} |
| 32 |
a := ndr.ReadUint32(b, p, e) |
| 33 |
return KerbSidAndAttributes{ |
| 34 |
SID: s, |
| 35 |
Attributes: a, |
| 36 |
}, nil |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
func SetFlag(a *uint32, i uint) { |
| 41 |
*a = *a | (1 << (31 - i)) |
| 42 |
} |