Merge pull request #5630 from rjnagal/libcontainer-fixes
Check supplied hostname before using it.
This commit is contained in:
commit
68de553fca
|
@ -66,8 +66,10 @@ func Init(container *libcontainer.Container, uncleanRootfs, consolePath string,
|
||||||
if err := mount.InitializeMountNamespace(rootfs, consolePath, container); err != nil {
|
if err := mount.InitializeMountNamespace(rootfs, consolePath, container); err != nil {
|
||||||
return fmt.Errorf("setup mount namespace %s", err)
|
return fmt.Errorf("setup mount namespace %s", err)
|
||||||
}
|
}
|
||||||
if err := system.Sethostname(container.Hostname); err != nil {
|
if container.Hostname != "" {
|
||||||
return fmt.Errorf("sethostname %s", err)
|
if err := system.Sethostname(container.Hostname); err != nil {
|
||||||
|
return fmt.Errorf("sethostname %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
|
|
Loading…
Reference in New Issue