@@ -15,12 +15,7 @@ func RemoveAction(arguments string, config *rspec.LinuxSeccomp) error {
1515 return fmt .Errorf ("Cannot remove action from nil Seccomp pointer" )
1616 }
1717
18- var syscallsToRemove []string
19- if strings .Contains (arguments , "," ) {
20- syscallsToRemove = strings .Split (arguments , "," )
21- } else {
22- syscallsToRemove = append (syscallsToRemove , arguments )
23- }
18+ syscallsToRemove := strings .Split (arguments , "," )
2419
2520 for counter , syscallStruct := range config .Syscalls {
2621 if reflect .DeepEqual (syscallsToRemove , syscallStruct .Names ) {
@@ -42,16 +37,11 @@ func RemoveAllSeccompRules(config *rspec.LinuxSeccomp) error {
4237}
4338
4439// RemoveAllMatchingRules will remove any syscall rules that match the specified action
45- func RemoveAllMatchingRules (config * rspec.LinuxSeccomp , action string ) error {
40+ func RemoveAllMatchingRules (config * rspec.LinuxSeccomp , seccompAction rspec. LinuxSeccompAction ) error {
4641 if config == nil {
4742 return fmt .Errorf ("Cannot remove action from nil Seccomp pointer" )
4843 }
4944
50- seccompAction , err := parseAction (action )
51- if err != nil {
52- return err
53- }
54-
5545 for _ , syscall := range config .Syscalls {
5646 if reflect .DeepEqual (syscall .Action , seccompAction ) {
5747 RemoveAction (strings .Join (syscall .Names , "," ), config )
0 commit comments