Skip to content

Commit

Permalink
Merge pull request #6715 from mheon/fix_security_exclusive
Browse files Browse the repository at this point in the history
Fix conflicts between privileged and other flags
  • Loading branch information
openshift-merge-robot authored Jun 22, 2020
2 parents 22942e3 + 13cfdb0 commit 22a7d60
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions cmd/podman/containers/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ func replaceContainer(name string) error {
}

func createInit(c *cobra.Command) error {
if c.Flag("privileged").Changed && c.Flag("security-opt").Changed {
logrus.Warn("setting security options with --privileged has no effect")
}

if c.Flag("shm-size").Changed {
cliVals.ShmSize = c.Flag("shm-size").Value.String()
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/specgen/container_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ func (s *SpecGenerator) Validate() error {
//
// ContainerSecurityConfig
//
// groups and privileged are exclusive
if len(s.Groups) > 0 && s.Privileged {
return exclusiveOptions("Groups", "privileged")
}
// capadd and privileged are exclusive
if len(s.CapAdd) > 0 && s.Privileged {
return exclusiveOptions("CapAdd", "privileged")
Expand Down
1 change: 1 addition & 0 deletions pkg/specgen/specgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ type ContainerSecurityConfig struct {
// - Adds all devices on the system to the container.
// - Adds all capabilities to the container.
// - Disables Seccomp, SELinux, and Apparmor confinement.
// (Though SELinux can be manually re-enabled).
// TODO: this conflicts with things.
// TODO: this does more.
Privileged bool `json:"privileged,omitempty"`
Expand Down

0 comments on commit 22a7d60

Please sign in to comment.