Skip to content

Commit

Permalink
[NO NEW TESTS NEEDED] [FreeBSD] Fix crash when running podman inspect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bcooksley committed Jan 16, 2024
1 parent a2fcca4 commit 971f2eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/container_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 971f2eb

Please sign in to comment.