summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-08-09 12:06:03 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-08-09 12:06:03 +0000
commit01b815a073101521e0b53cf4ce8fa9c81b5fc5d8 (patch)
treec0869507e4f2a58769493f028b8e0066790fcc32 /src/init
parent98e4d43adcf15235b1441bfb3163fc8305854493 (diff)
downloads6-linux-init-01b815a073101521e0b53cf4ce8fa9c81b5fc5d8.tar.xz
Trap CAD in stage 1; prepare for 1.0.3.0
Diffstat (limited to 'src/init')
-rw-r--r--src/init/s6-linux-init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/init/s6-linux-init.c b/src/init/s6-linux-init.c
index 75c9eee..78cf3d0 100644
--- a/src/init/s6-linux-init.c
+++ b/src/init/s6-linux-init.c
@@ -7,6 +7,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/mount.h>
+#include <sys/reboot.h>
#include <skalibs/types.h>
#include <skalibs/allreadwrite.h>
@@ -19,7 +20,6 @@
#include <s6/config.h>
#include <s6-linux-init/config.h>
-
#include "defaults.h"
#include "initctl.h"
@@ -181,6 +181,8 @@ int main (int argc, char const **argv, char const *const *envp)
pid = fork() ;
if (pid == -1) strerr_diefu1sys(111, "fork") ;
if (!pid) run_stage2(basedir, argv, argc, newenvp, !!path, envmodifs.s, envmodifs.len, initdefault) ;
+ if (reboot(RB_DISABLE_CAD) == -1)
+ strerr_warnwu1sys("trap ctrl-alt-del") ;
if (fd_copy(2, 1) == -1)
strerr_diefu1sys(111, "redirect output file descriptor") ;
xpathexec_r(newargv, newenvp, !!path, envmodifs.s, envmodifs.len) ;