mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-18 13:48:00 +00:00
[NO TESTS NEEDED] Create /etc/mtab with the correct ownership
Create the /etc and /etc/mtab directories with the correct ownership based on what the UID and GID is for the container. This was causing issue when starting the infra container with userns as the /etc directory wasn't being created with the correct ownership. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
parent
e50e0dad90
commit
9db534e53a
1 changed files with 1 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue