diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-23 16:12:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 16:12:45 -0400 |
commit | fc34f35e3f984c8a76136227168b3f8b65b15101 (patch) | |
tree | b817eb1973a6cdecc9c96990e2f33a6e67037ea9 /libpod | |
parent | e1a7a0efbeec4950815a29372a1c932bbf1bc9fb (diff) | |
parent | 9db534e53af884abfbcea2bd0efbbb89ca0b949c (diff) | |
download | podman-fc34f35e3f984c8a76136227168b3f8b65b15101.tar.gz podman-fc34f35e3f984c8a76136227168b3f8b65b15101.tar.bz2 podman-fc34f35e3f984c8a76136227168b3f8b65b15101.zip |
Merge pull request #10765 from umohnani8/mtab
Create /etc/mtab with the correct ownership
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 2 |
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) { |