mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
[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:
@ -315,7 +315,7 @@ func (c *Container) GetSecurityOptions() []string {
|
|||||||
if apparmor, ok := ctrSpec.Annotations[define.InspectAnnotationApparmor]; ok {
|
if apparmor, ok := ctrSpec.Annotations[define.InspectAnnotationApparmor]; ok {
|
||||||
SecurityOpt = append(SecurityOpt, fmt.Sprintf("apparmor=%s", apparmor))
|
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")
|
SecurityOpt = append(SecurityOpt, "unmask=all")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user