]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc.init: Ignore user signals coming from inside the contianer
authorStéphane Graber <stgraber@stgraber.org>
Mon, 16 Dec 2024 19:25:14 +0000 (14:25 -0500)
committerStéphane Graber <stgraber@stgraber.org>
Mon, 16 Dec 2024 19:25:14 +0000 (14:25 -0500)
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
src/lxc/initutils.c

index 1cc1e695bee1a87d585f478177d56eced94f1058..86b031c28d629067c1982685bb64f962bdb42968 100644 (file)
@@ -427,6 +427,11 @@ static sig_atomic_t was_interrupted;
 
 static void interrupt_handler(int sig, siginfo_t *info, void *context)
 {
+       // Only forward signals if they didn't originate from our own PID
+       // namespace and if no other signal is already being processed.
+       if (info->si_code == SI_USER && info->si_pid > 1)
+               return;
+
        if (!was_interrupted)
                was_interrupted = sig;
 }