From 806a9b822b4dd413f080afee37cd4088bbc1af64 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Wed, 3 Jul 2019 14:30:11 +0200 Subject: [PATCH] e2build: pty use breaks fg session signal handling, revert Signal handling involving a pty and a foreground process inside the chroot turns out to be very tricky. Having the ability to terminate suid e2-su and also send eg. ^C to a vim inside doesn't appear to be documented much. There are a few hints in sudo and related MLs. Since it's more important to interact with applications in playground than being able to reliably terminate e2-su, opt for a non-pty controlled playground environment for the time being. Signed-off-by: Tobias Ulmer --- local/e2build.lua | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/local/e2build.lua b/local/e2build.lua index d85aabc..bd22622 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -265,21 +265,8 @@ function e2build.build_process_class:_enter_playground(res, rbs) table.insert(cmd, "-c") table.insert(cmd, rbs:build_settings():command()) - -- The shell is for interactive use, but we still want a pty for terminating - -- e2-su via signal. - -- This means we have to save the standard file descriptors and re-dup2 them - -- in place after forkpty. - local fdctv = {} - for _,fd in ipairs({eio.STDIN, eio.STDOUT, eio.STDERR}) do - local fdnew, re = eio.dup(fd) - if not fdnew then - return false, e:cat(re) - end - table.insert(fdctv, { dup = fd, istype = "readfo", file = fdnew }) - end - e2tool.set_umask() - rc, re = e2lib.callcmd(cmd, fdctv, nil, nil, nil, true) + rc, re = e2lib.callcmd(cmd, {}, nil, nil, nil, false) if not rc then e2tool.reset_umask() return false, e:cat(re) -- 2.39.5