mirror of
https://github.com/containers/podman.git
synced 2025-05-23 01:57:56 +08:00
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>
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
// +build seccomp ostree selinux varlink exclude_graphdriver_devicemapper
|
||||||
|
|
||||||
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
|
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
|
||||||
|
|
||||||
package libpod
|
package libpod
|
||||||
|
@ -1068,7 +1068,12 @@ func (c *Container) generateResolvConf() (string, error) {
|
|||||||
return "", errors.Wrapf(err, "error building resolv.conf for container %s")
|
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
|
// generateHosts creates a containers hosts file
|
||||||
|
Reference in New Issue
Block a user