mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Partial refactor of UID/GID usage to use a unified struct.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
@@ -54,8 +54,8 @@ func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, er
|
||||
return nil
|
||||
}
|
||||
|
||||
rootUID, rootGID := daemon.GetRemappedUIDGID()
|
||||
path, err := m.Setup(c.MountLabel, rootUID, rootGID, checkfunc)
|
||||
rootIDs, _ := daemon.idMappings.RootPair()
|
||||
path, err := m.Setup(c.MountLabel, rootIDs, checkfunc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -85,9 +85,9 @@ func (daemon *Daemon) setupMounts(c *container.Container) ([]container.Mount, er
|
||||
// if we are going to mount any of the network files from container
|
||||
// metadata, the ownership must be set properly for potential container
|
||||
// remapped root (user namespaces)
|
||||
rootUID, rootGID := daemon.GetRemappedUIDGID()
|
||||
rootIDs, _ := daemon.idMappings.RootPair()
|
||||
for _, mount := range netMounts {
|
||||
if err := os.Chown(mount.Source, rootUID, rootGID); err != nil {
|
||||
if err := os.Chown(mount.Source, rootIDs.UID, rootIDs.GID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user