Skip to content

Commit

Permalink
Merge pull request #10765 from umohnani8/mtab
Browse files Browse the repository at this point in the history
Create /etc/mtab with the correct ownership
  • Loading branch information
openshift-merge-robot authored Jun 23, 2021
2 parents e1a7a0e + 9db534e commit fc34f35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fc34f35

Please sign in to comment.