From 51ff724691385e1b4436b9ff0570486bb02466fe Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 7 Jul 2019 12:30:57 -0700 Subject: [PATCH] Unblock all signals in root shell process Fix #1563 --- native/jni/su/su_daemon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/native/jni/su/su_daemon.cpp b/native/jni/su/su_daemon.cpp index 0b5c759d5..d3d240b90 100644 --- a/native/jni/su/su_daemon.cpp +++ b/native/jni/su/su_daemon.cpp @@ -352,6 +352,10 @@ void su_daemon_handler(int client, struct ucred *credential) { } } + // Unblock all signals + sigset_t block_set; + sigemptyset(&block_set); + sigprocmask(SIG_SETMASK, &block_set, nullptr); set_identity(ctx.req.uid); execvp(ctx.req.shell, (char **) argv); fprintf(stderr, "Cannot execute %s: %s\n", ctx.req.shell, strerror(errno));