c8d/mount: Create same directory owners as graphdrivers

Graph drivers create the parent directory with
rootPair().GID:CurrentIdentity().UID owner. This change brings these in
line

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
Djordje Lukic 2023-09-05 13:50:46 +02:00
parent 6ce5aa1cd5
commit 833b514d98
No known key found for this signature in database

View file

@ -93,7 +93,13 @@ func (m *refCountMounter) Mount(mounts []mount.Mount, containerID string) (targe
}()
root := m.idMap.RootPair()
if err := idtools.MkdirAllAndChown(target, 0o700, root); err != nil {
if err := idtools.MkdirAllAndChown(filepath.Dir(target), 0o710, idtools.Identity{
UID: idtools.CurrentIdentity().UID,
GID: root.GID,
}); err != nil {
return "", err
}
if err := idtools.MkdirAllAndChown(target, 0o710, root); err != nil {
return "", err
}