mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
container: do not add shm in rootless mode
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #871 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
ca03627a80
commit
1e8ef3c897
@ -685,15 +685,15 @@ func (c *Container) mountStorage() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if os.Getuid() == 0 {
|
||||
// TODO: generalize this mount code so it will mount every mount in ctr.config.Mounts
|
||||
|
||||
mounted, err := mount.Mounted(c.config.ShmDir)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "unable to determine if %q is mounted", c.config.ShmDir)
|
||||
}
|
||||
|
||||
if err := os.Chown(c.config.ShmDir, c.RootUID(), c.RootGID()); err != nil {
|
||||
return err
|
||||
return errors.Wrapf(err, "failed to chown %s", c.config.ShmDir)
|
||||
}
|
||||
|
||||
if !mounted {
|
||||
@ -706,6 +706,7 @@ func (c *Container) mountStorage() (err error) {
|
||||
return errors.Wrapf(err, "failed to chown %s", c.config.ShmDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mountPoint := c.config.Rootfs
|
||||
if mountPoint == "" {
|
||||
|
Reference in New Issue
Block a user