Files
podman/pkg/specgen/generate/security_freebsd.go
Matt Heon 72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00

38 lines
1007 B
Go

//go:build !remote
package generate
import (
"github.com/containers/common/libimage"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v5/libpod"
"github.com/containers/podman/v5/pkg/specgen"
"github.com/opencontainers/runtime-tools/generate"
)
// setLabelOpts sets the label options of the SecurityConfig according to the
// input.
func setLabelOpts(s *specgen.SpecGenerator, runtime *libpod.Runtime, pidConfig specgen.Namespace, ipcConfig specgen.Namespace) error {
return nil
}
func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, newImage *libimage.Image, rtc *config.Config) error {
// If this is a privileged container, change the devfs ruleset to expose all devices.
if s.IsPrivileged() {
for k, m := range g.Config.Mounts {
if m.Type == "devfs" {
m.Options = []string{
"ruleset=0",
}
g.Config.Mounts[k] = m
}
}
}
if s.ReadOnlyFilesystem != nil {
g.SetRootReadonly(*s.ReadOnlyFilesystem)
}
return nil
}