mirror of https://github.com/containers/podman.git
[NO NEW TESTS NEEDED] [FreeBSD] Fix crash when running podman inspect
When preparing container inspection output, ensure we actually have masked paths to work with. These will only be available on Linux, which is no longer always true as we also support FreeBSD now. Fixes #21117 Signed-off-by: Ben Cooksley <bcooksley@kde.org>
This commit is contained in:
parent
a2fcca4066
commit
971f2eb45a
|
@ -315,7 +315,7 @@ func (c *Container) GetSecurityOptions() []string {
|
|||
if apparmor, ok := ctrSpec.Annotations[define.InspectAnnotationApparmor]; ok {
|
||||
SecurityOpt = append(SecurityOpt, fmt.Sprintf("apparmor=%s", apparmor))
|
||||
}
|
||||
if c.config.Spec.Linux.MaskedPaths == nil {
|
||||
if c.config.Spec != nil && c.config.Spec.Linux != nil && c.config.Spec.Linux.MaskedPaths == nil {
|
||||
SecurityOpt = append(SecurityOpt, "unmask=all")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue