Skip to content

Commit

Permalink
may kill other process when container has been stopped
Browse files Browse the repository at this point in the history
Signed-off-by: Lifubang <lifubang@acmcoder.com>
  • Loading branch information
lifubang committed Nov 19, 2018
1 parent bbe4b6f commit 072f8b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,18 @@ func (c *linuxContainer) start(process *Process) error {
return nil
}

func (c *linuxContainer) Kill(s os.Signal, all bool) error {
}

func (c *linuxContainer) Signal(s os.Signal, all bool) error {
status, err := c.currentStatus()
if err != nil {
return err
}
// to avoid a PID reuse attack
if status == Stopped {
return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning)
}
if all {
return signalAllProcesses(c.cgroupManager, s)
}
Expand Down

0 comments on commit 072f8b1

Please # to comment.