summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpod/container_internal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 545b78976..2555f15ec 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1535,7 +1535,7 @@ func (c *Container) mountStorage() (_ string, deferredErr error) {
// If /etc/mtab does not exist in container image, then we need to
// create it, so that mount command within the container will work.
mtab := filepath.Join(mountPoint, "/etc/mtab")
- if err := os.MkdirAll(filepath.Dir(mtab), 0755); err != nil {
+ if err := idtools.MkdirAllAs(filepath.Dir(mtab), 0755, c.RootUID(), c.RootGID()); err != nil {
return "", errors.Wrap(err, "error creating mtab directory")
}
if err = os.Symlink("/proc/mounts", mtab); err != nil && !os.IsExist(err) {