mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
runc version: don't use seccomp.IsEnabled
As pointed out to in [1], seccomp.IsEnabled does some runtime checks, while here (when printing libseccomp version) we should merely print the version number of libseccomp, if compiled in. Change the code to check if the version is non-zero (as seccomp.Version returns 0, 0, 0 in case seccomp is not compiled in. [1] https://github.com/opencontainers/runc/pull/2866 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -64,8 +64,9 @@ func main() {
|
||||
}
|
||||
v = append(v, "spec: "+specs.Version)
|
||||
v = append(v, "go: "+runtime.Version())
|
||||
if seccomp.IsEnabled() {
|
||||
major, minor, micro := seccomp.Version()
|
||||
|
||||
major, minor, micro := seccomp.Version()
|
||||
if major+minor+micro > 0 {
|
||||
v = append(v, fmt.Sprintf("libseccomp: %d.%d.%d", major, minor, micro))
|
||||
}
|
||||
app.Version = strings.Join(v, "\n")
|
||||
|
||||
Reference in New Issue
Block a user