Fix force denying on exit

This commit is contained in:
topjohnwu 2018-06-26 17:33:16 +08:00
parent 30e459252c
commit caa39474cb

3
su.c
View File

@ -152,8 +152,7 @@ static void cleanup_signal(int sig) {
__attribute__ ((noreturn)) void exit2(int status) { __attribute__ ((noreturn)) void exit2(int status) {
// Handle the pipe, or the daemon will get stuck // Handle the pipe, or the daemon will get stuck
if (su_ctx->pipefd[0] >= 0) { if (su_ctx->pipefd[0] >= 0) {
int i = DENY; xwrite(su_ctx->pipefd[1], &su_ctx->info->access.policy, sizeof(policy_t));
xwrite(su_ctx->pipefd[1], &i, sizeof(i));
close(su_ctx->pipefd[0]); close(su_ctx->pipefd[0]);
close(su_ctx->pipefd[1]); close(su_ctx->pipefd[1]);
} }