mirror of https://github.com/docker/docs.git
Merge pull request #19179 from estesp/btrfs-userns-perms
Fix btrfs subvolume snapshot dir perms for user namespaces
This commit is contained in:
commit
9e9d7dc884
|
@ -266,6 +266,14 @@ func (d *Driver) Create(id, parent, mountLabel string) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we have a remapped root (user namespaces enabled), change the created snapshot
|
||||||
|
// dir ownership to match
|
||||||
|
if rootUID != 0 || rootGID != 0 {
|
||||||
|
if err := os.Chown(path.Join(subvolumes, id), rootUID, rootGID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return label.Relabel(path.Join(subvolumes, id), mountLabel, false)
|
return label.Relabel(path.Join(subvolumes, id), mountLabel, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue