mirror of https://github.com/containers/podman.git
Merge pull request #13744 from giuseppe/allow-privileged-cap-add
specgen: permit --privileged and --cap-add
This commit is contained in:
commit
59fcf0e39d
|
@ -83,10 +83,6 @@ func (s *SpecGenerator) Validate() error {
|
|||
//
|
||||
// ContainerSecurityConfig
|
||||
//
|
||||
// capadd and privileged are exclusive
|
||||
if len(s.CapAdd) > 0 && s.Privileged {
|
||||
return exclusiveOptions("CapAdd", "privileged")
|
||||
}
|
||||
// userns and idmappings conflict
|
||||
if s.UserNS.IsPrivate() && s.IDMappings == nil {
|
||||
return errors.Wrap(ErrInvalidSpecConfig, "IDMappings are required when not creating a User namespace")
|
||||
|
|
|
@ -535,6 +535,11 @@ var _ = Describe("Podman run", func() {
|
|||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("0000000000000000"))
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--user=1:1", "--cap-add=DAC_OVERRIDE", "--rm", ALPINE, "grep", "CapEff", "/proc/self/status"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("0000000000000002"))
|
||||
|
||||
if os.Geteuid() > 0 {
|
||||
if os.Getenv("SKIP_USERNS") != "" {
|
||||
Skip("Skip userns tests.")
|
||||
|
|
Loading…
Reference in New Issue