1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #18505 from estesp/overlay-userns-fix

Fix overlay + user namespaces underlay dir permissions
This commit is contained in:
David Calavera 2015-12-08 12:44:46 -08:00
commit 81014900d5

View file

@ -270,10 +270,10 @@ func (d *Driver) Create(id, parent, mountLabel string) (retErr error) {
parentRoot := path.Join(parentDir, "root") parentRoot := path.Join(parentDir, "root")
if s, err := os.Lstat(parentRoot); err == nil { if s, err := os.Lstat(parentRoot); err == nil {
if err := os.Mkdir(path.Join(dir, "upper"), s.Mode()); err != nil { if err := idtools.MkdirAs(path.Join(dir, "upper"), s.Mode(), rootUID, rootGID); err != nil {
return err return err
} }
if err := os.Mkdir(path.Join(dir, "work"), 0700); err != nil { if err := idtools.MkdirAs(path.Join(dir, "work"), 0700, rootUID, rootGID); err != nil {
return err return err
} }
if err := idtools.MkdirAs(path.Join(dir, "merged"), 0700, rootUID, rootGID); err != nil { if err := idtools.MkdirAs(path.Join(dir, "merged"), 0700, rootUID, rootGID); err != nil {
@ -303,10 +303,10 @@ func (d *Driver) Create(id, parent, mountLabel string) (retErr error) {
} }
upperDir := path.Join(dir, "upper") upperDir := path.Join(dir, "upper")
if err := os.Mkdir(upperDir, s.Mode()); err != nil { if err := idtools.MkdirAs(upperDir, s.Mode(), rootUID, rootGID); err != nil {
return err return err
} }
if err := os.Mkdir(path.Join(dir, "work"), 0700); err != nil { if err := idtools.MkdirAs(path.Join(dir, "work"), 0700, rootUID, rootGID); err != nil {
return err return err
} }
if err := idtools.MkdirAs(path.Join(dir, "merged"), 0700, rootUID, rootGID); err != nil { if err := idtools.MkdirAs(path.Join(dir, "merged"), 0700, rootUID, rootGID); err != nil {