1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #9625 from LK4D4/fix_race_in_sec_opts

Fix race condition between parseSecurityOpt and container.Mount
This commit is contained in:
Jessie Frazelle 2014-12-12 11:34:59 -08:00
commit b66abaa291

View file

@ -44,6 +44,8 @@ func (daemon *Daemon) ContainerStart(job *engine.Job) engine.Status {
}
func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.HostConfig) error {
container.Lock()
defer container.Unlock()
if err := parseSecurityOpt(container, hostConfig); err != nil {
return err
}
@ -66,8 +68,8 @@ func (daemon *Daemon) setHostConfig(container *Container, hostConfig *runconfig.
if err := daemon.RegisterLinks(container, hostConfig); err != nil {
return err
}
container.SetHostConfig(hostConfig)
container.ToDisk()
container.hostConfig = hostConfig
container.toDisk()
return nil
}