]> git.e2factory.org Git - e2factory.git/commitdiff
e2build: pty use breaks fg session signal handling, revert
authorTobias Ulmer <tu@emlix.com>
Wed, 3 Jul 2019 12:30:11 +0000 (14:30 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 3 Jul 2019 12:30:26 +0000 (14:30 +0200)
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 <tu@emlix.com>
local/e2build.lua

index d85aabcdadf9b011d4a301d505d2e94f78fb0c72..bd2262231628a85d7b97371274a4e60957b8668e 100644 (file)
@@ -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)