Skip to content

Commit d864b88

Browse files
committed
fix misspel
1 parent 7b2f2f8 commit d864b88

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

gosddl.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
// ACLProcessor main struct with methods
1515
type ACLProcessor struct {
16-
Rights permissons
16+
Rights permissions
1717
File string
1818
}
1919

@@ -26,7 +26,7 @@ type entryACL struct {
2626
InheritObjectGUID string `json:"inheritObjectGUID,omitempty"`
2727
}
2828

29-
type permissons struct {
29+
type permissions struct {
3030
Owner string `json:"owner,omitempty"`
3131
Primary string `json:"primary,omitempty"`
3232
Dacl []entryACL `json:"dacl,omitempty"`
@@ -181,15 +181,15 @@ func (app *ACLProcessor) findGroupIndex(str string) error {
181181

182182
// Processor main function in gosddl package
183183
func (app *ACLProcessor) Processor(str string) error {
184-
err := app.findGroupIndex(str)
185-
if err != nil {
186-
return err
187-
}
188-
body, err := json.Marshal(app.Rights)
189-
if err != nil {
190-
log.Fatal(err)
191-
return err
192-
}
193-
fmt.Println(string(body))
194-
return nil
195-
}
184+
err := app.findGroupIndex(str)
185+
if err != nil {
186+
return err
187+
}
188+
body, err := json.Marshal(app.Rights)
189+
if err != nil {
190+
log.Fatal(err)
191+
return err
192+
}
193+
fmt.Println(string(body))
194+
return nil
195+
}

gosddl_test.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func TestFindGroupIndex(t *testing.T) {
2727
}
2828
}
2929

30-
3130
func TestFindGroupIndex2(t *testing.T) {
3231
var app ACLProcessor
3332
testStr := "{O:WA,G:SA,D:(SA;DA;;;;DA),S:AI(SA;DA;;;;ST)}"
@@ -38,15 +37,14 @@ func TestFindGroupIndex2(t *testing.T) {
3837
}
3938
}
4039

41-
4240
func TestSidReplace(t *testing.T) {
4341
data := []byte("S-10-10,User\n")
4442
err := ioutil.WriteFile("test.txt", data, 0644)
4543
if err != nil {
4644
t.Error("can't write data test.txt", err)
4745
return
4846
}
49-
str := checkSIDsFile("test.txt","S-10-10")
47+
str := checkSIDsFile("test.txt", "S-10-10")
5048
err = os.Remove("test.txt")
5149
if err != nil {
5250
t.Error("can't delete file", err)
@@ -55,7 +53,7 @@ func TestSidReplace(t *testing.T) {
5553
if str == "User" {
5654
return
5755
}
58-
t.Errorf("replaced name doesn't match result: %s",str)
56+
t.Errorf("replaced name doesn't match result: %s", str)
5957
}
6058

6159
func TestReplacer(t *testing.T) {
@@ -65,7 +63,7 @@ func TestReplacer(t *testing.T) {
6563
if str == "Network" {
6664
return
6765
}
68-
t.Errorf("replaced name doesn't match result: %s",str)
66+
t.Errorf("replaced name doesn't match result: %s", str)
6967
}
7068

7169
func TestSplitBodyACL(t *testing.T) {
@@ -76,4 +74,4 @@ func TestSplitBodyACL(t *testing.T) {
7674
t.Error("function return nil data")
7775
return
7876
}
79-
}
77+
}

http.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ func (app *ACLProcessor) decode(w http.ResponseWriter, r *http.Request) {
2121
log.Println("Wrong SDDL string")
2222
}
2323
json.NewEncoder(w).Encode(app.Rights)
24-
app.Rights = permissons{}
24+
app.Rights = permissions{}
2525
return
2626
}
2727
}
2828

29+
// HTTPHandler start http serve
2930
func (app *ACLProcessor) HTTPHandler(port string) {
3031
router := mux.NewRouter()
3132
router.HandleFunc("/sddl", getInfo).Methods("GET")
3233
router.HandleFunc("/sddl/{sddl}", app.decode).Methods("GET")
3334
log.Fatal(http.ListenAndServe(port, router))
34-
}
35+
}

http_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ func TestGetInfo(t *testing.T) {
2424
rr.Body.String(), expected)
2525
}
2626
}
27-

maps.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,4 @@ var sddlWellKnownSidsRep = map[string]string{
181181
"S-1-5-32-579": "BUILTIN\\Access Control Assistance Operators",
182182
"S-1-5-32-580": "BUILTIN\\Remote Management Users",
183183
"S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464": "Trusted Installer",
184-
}
184+
}

service/gosddl/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"flag"
55

6-
"github.com/MonaxGT/gosddl"
76
"fmt"
7+
"github.com/MonaxGT/gosddl"
88
)
99

1010
func main() {
@@ -24,4 +24,4 @@ func main() {
2424
}
2525
}
2626
panic("You should give me SDDL string or use API mode")
27-
}
27+
}

0 commit comments

Comments
 (0)