mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
fix(libpod): add newline character to the end of container's hostname file
debian's man (5) hostname page states "The file should contain a single newline-terminated hostname string." [NO NEW TESTS NEEDED] fix #22729 Signed-off-by: Bo Wang <wangbob@uniontech.com>
This commit is contained in:
@ -664,7 +664,7 @@ func (c *Container) makePlatformBindMounts() error {
|
||||
// Make /etc/hostname
|
||||
// This should never change, so no need to recreate if it exists
|
||||
if _, ok := c.state.BindMounts["/etc/hostname"]; !ok {
|
||||
hostnamePath, err := c.writeStringToRundir("hostname", c.Hostname())
|
||||
hostnamePath, err := c.writeStringToRundir("hostname", c.Hostname()+"\n")
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating hostname file for container %s: %w", c.ID(), err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user