Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #25 from giuseppe/simplify-generation
Browse files Browse the repository at this point in the history
seccomp: generate smaller OCI configuration
  • Loading branch information
rhatdan authored May 12, 2020
2 parents ed5dfb1 + 1621045 commit f145e54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions seccomp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ Loop:
}

if call.Name != "" {
newConfig.Syscalls = append(newConfig.Syscalls, createSpecsSyscall(call.Name, call.Action, call.Args))
newConfig.Syscalls = append(newConfig.Syscalls, createSpecsSyscall([]string{call.Name}, call.Action, call.Args))
}

for _, n := range call.Names {
newConfig.Syscalls = append(newConfig.Syscalls, createSpecsSyscall(n, call.Action, call.Args))
if len(call.Names) > 0 {
newConfig.Syscalls = append(newConfig.Syscalls, createSpecsSyscall(call.Names, call.Action, call.Args))
}
}

return newConfig, nil
}

func createSpecsSyscall(name string, action Action, args []*Arg) specs.LinuxSyscall {
func createSpecsSyscall(names []string, action Action, args []*Arg) specs.LinuxSyscall {
newCall := specs.LinuxSyscall{
Names: []string{name},
Names: names,
Action: specs.LinuxSeccompAction(action),
}

Expand Down

0 comments on commit f145e54

Please sign in to comment.