Merge pull request #5630 from rjnagal/libcontainer-fixes

Check supplied hostname before using it.
This commit is contained in:
Michael Crosby 2014-05-06 09:49:52 -07:00
commit 68de553fca
1 changed files with 4 additions and 2 deletions

View File

@ -66,9 +66,11 @@ func Init(container *libcontainer.Container, uncleanRootfs, consolePath string,
if err := mount.InitializeMountNamespace(rootfs, consolePath, container); err != nil {
return fmt.Errorf("setup mount namespace %s", err)
}
if container.Hostname != "" {
if err := system.Sethostname(container.Hostname); err != nil {
return fmt.Errorf("sethostname %s", err)
}
}
runtime.LockOSThread()