(hexSID string)
| 140 | } |
| 141 | |
| 142 | func convertSID(hexSID string) (SID string) { |
| 143 | //https://devblogs.microsoft.com/oldnewthing/20040315-00/?p=40253 |
| 144 | var fields []string |
| 145 | fields = append(fields, hexSID[0:2]) |
| 146 | if fields[0] == "01" { |
| 147 | fields[0] = "S-1" |
| 148 | } |
| 149 | numDashes, _ := strconv.Atoi(hexToDecimalString(hexSID[2:4])) |
| 150 | |
| 151 | fields = append(fields, "-"+hexToDecimalString(hexSID[4:16])) |
| 152 | |
| 153 | lower, upper := 16, 24 |
| 154 | for i := 1; i <= numDashes; i++ { |
| 155 | fields = append(fields, "-"+hexToDecimalString(endianConvert(hexSID[lower:upper]))) |
| 156 | lower += 8 |
| 157 | upper += 8 |
| 158 | } |
| 159 | |
| 160 | for i := 0; i < len(fields); i++ { |
| 161 | SID += (fields[i]) |
| 162 | } |
| 163 | |
| 164 | return |
| 165 | } |
| 166 | |
| 167 | func getDACL(header *HEADER, sd string) (DACL string) { |
| 168 | offset := hexToOffset(header.OffsetDacl) |
no test coverage detected