Skip to content

Commit

Permalink
config-linux: Make linux.seccomp.syscalls OPTIONAL
Browse files Browse the repository at this point in the history
Before this commit, linux.seccomp.sycalls was required, but we didn't
require an entry in the array.  That means '"syscalls": []' would be
technically valid, and I'm pretty sure that's not what we want.

If it makes sense to have a seccomp property that does not need
syscalls entries, then syscalls should be optional (which is what this
commit is doing).

If it does not makes sense to have an empty/unset syscalls then it
should be required and have a minimum length of one.

Before 652323c (improve seccomp format to be more expressive,
2017-01-13, #657), syscalls was omitempty (and therefore more
optional-feeling, although there was no real Markdown spec for seccomp
before 3ca5c6c, config-linux.md: fix seccomp, 2017-03-02, #706, so
it's hard to know).  This commit has gone with OPTIONAL, because a
seccomp config which only sets defaultAction seems potentially valid.

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Apr 12, 2017
1 parent cfc95a5 commit 7dad383
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config-linux.md
Expand Up @@ -610,7 +610,7 @@ The following parameters can be specified to setup seccomp:
* `SCMP_ARCH_PARISC`
* `SCMP_ARCH_PARISC64`

* **`syscalls`** *(array of objects, REQUIRED)* - match a syscall in seccomp.
* **`syscalls`** *(array of objects, OPTIONAL)* - match a syscall in seccomp.

Each entry has the following structure:

Expand Down
2 changes: 1 addition & 1 deletion specs-go/config.go
Expand Up @@ -484,7 +484,7 @@ type WindowsNetworkResources struct {
type LinuxSeccomp struct {
DefaultAction LinuxSeccompAction `json:"defaultAction"`
Architectures []Arch `json:"architectures,omitempty"`
Syscalls []LinuxSyscall `json:"syscalls"`
Syscalls []LinuxSyscall `json:"syscalls,omitempty"`
}

// Arch used for additional architectures
Expand Down

0 comments on commit 7dad383

Please sign in to comment.