]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
fix signal sending in lxc.init
authorTycho Andersen <tycho@tycho.ws>
Wed, 4 Apr 2018 23:45:29 +0000 (17:45 -0600)
committerTycho Andersen <tycho@tycho.ws>
Wed, 4 Apr 2018 23:50:50 +0000 (17:50 -0600)
commit9cb943843a70cef5478d224615ca53c315020ef3
tree081336eb86d7e3075de87a778ce9813ad288713f
parent22b2b9c87cd63e6bd7445c2159a0f7d6aa2b7368
fix signal sending in lxc.init

The problem here is that these two clauses were ordered backwards: we first
check if the signal came from not the init pid, and if it did, then we give
a notice and return. The comment notes that this is intended to protect
against SIGCHLD, but we don't in fact know if the signal is a SIGCHLD yet,
because that's tested in the next hunk.

The symptom is that if I e.g. send SIGTERM from the outside world to the
container init, it ignores it and gives this notice. If we re-order these
clauses, it forwards non SIGCHLD signals, and ignores SIGCHLD signals from
things that aren't the real container process.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/start.c