Skip to content

Commit fc34f35

Browse files
Merge pull request #10765 from umohnani8/mtab
Create /etc/mtab with the correct ownership
2 parents e1a7a0e + 9db534e commit fc34f35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libpod/container_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ func (c *Container) mountStorage() (_ string, deferredErr error) {
15351535
// If /etc/mtab does not exist in container image, then we need to
15361536
// create it, so that mount command within the container will work.
15371537
mtab := filepath.Join(mountPoint, "/etc/mtab")
1538-
if err := os.MkdirAll(filepath.Dir(mtab), 0755); err != nil {
1538+
if err := idtools.MkdirAllAs(filepath.Dir(mtab), 0755, c.RootUID(), c.RootGID()); err != nil {
15391539
return "", errors.Wrap(err, "error creating mtab directory")
15401540
}
15411541
if err = os.Symlink("/proc/mounts", mtab); err != nil && !os.IsExist(err) {

0 commit comments

Comments
 (0)