diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-10-04 17:38:09 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-10-04 17:38:09 -0400 |
commit | e9ab8583d0a73c686591edfb8b4dfdca212d5eb6 (patch) | |
tree | fb707f25e3860eab1b9024952172738607a21ea2 /libpod/container_internal.go | |
parent | ae5af67d61e52215996c9ba586dbeea1e8fca426 (diff) | |
download | podman-e9ab8583d0a73c686591edfb8b4dfdca212d5eb6.tar.gz podman-e9ab8583d0a73c686591edfb8b4dfdca212d5eb6.tar.bz2 podman-e9ab8583d0a73c686591edfb8b4dfdca212d5eb6.zip |
Ensure resolv.conf has the right label and path
Adds a few missing things from writeStringToRundir() to the new
resolv.conf function, specifically relabelling and returning a
path compatible with rootless podman
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 9f584d2e2..77bba9e85 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1068,7 +1068,12 @@ func (c *Container) generateResolvConf() (string, error) { return "", errors.Wrapf(err, "error building resolv.conf for container %s") } - return destPath, nil + // Relabel resolv.conf for the container + if err := label.Relabel(destPath, c.config.MountLabel, false); err != nil { + return "", err + } + + return filepath.Join(c.state.DestinationRunDir, "resolv.conf"), nil } // generateHosts creates a containers hosts file |