Commit Graph

9 Commits

Author SHA1 Message Date
Oleksandr Redko ba4c7c98bb chore: remove outdated build constraints
Signed-off-by: Oleksandr Redko <Oleksandr_Redko@epam.com>
2024-01-03 22:56:00 +02:00
Kir Kolyshkin b951b72412 Gofumpt the code
gofumpt is a stricter version of gofmt, basically making the code more
readable, and fixing the gocritic's octalLiterar warnings like this one:

	pkg/util/util_supported.go:26:17: octalLiteral: use new octal literal style, 0o722 (gocritic)
		return (perm & 0722) == 0700
			       ^

Generated by gofumpt -w .

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-04-09 16:50:11 -07:00
Sascha Grunert e2ebb542c8 Add support for seccomp `ListenerPath` and `ListenerMetadata`
We have to copy both fields in the same way we did with the flags to
support them in container runtimes.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-02-28 11:37:02 +01:00
Sascha Grunert 941bc06e84 Add support for seccomp filter flags
crun supports seccomp filter flags since fefabffa28
runc will get them with https://github.com/opencontainers/runc/pull/3390
youki will get them with https://github.com/containers/youki/pull/733

To support them generally, we now copy the flags during the seccomp
setup, otherwise they will get lost.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-02-23 12:02:13 +01:00
Giuseppe Scrivano c0d068931f seccomp: accept strings for errno values
simplify maintainance of the seccomp.json file and accept errno as
strings.

It also fixes a portability problem since errno values are arch
dependent.

The existing `DefaultErrnoRet` and `ErrnoRet` are maintained for
backward compatibility but they are obsoleted and will be removed in a
future release.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-09 11:41:03 +01:00
Giuseppe Scrivano c2495428c7 seccomp: refactor code out
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-09 11:40:58 +01:00
Giuseppe Scrivano c662eb936b seccomp: add support for defaultErrnoRet
Add support to specify the default errno return value.

The OCI runtime specs already have support for it, and both crun (>=
0.19) and runc (>= 1.0-rc95) have support for it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-06-14 19:08:06 +02:00
Sascha Grunert 8270dcffb5 Add BuildFilter() and ValidateProfile() API
The new `BuildFilter()` API can be used by runc/libcontainer to build
a libseccomp filter from the spec. This means that they also do not need
any internal structures any more because we indirectly build it from the
internal `Seccomp` type.

The new `ValidateProfile()` API can be used by higher level consumers,
which want to ensure that a seccomp profile string can be transferred
into a libseccomp filter.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-27 21:09:59 +02:00
Sascha Grunert 5f1c701c68 Migrate seccomp/containers-golang
This migrates the repository from github.com/seccomp/containers-golang
into this library.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-27 10:15:31 +02:00