summaryrefslogtreecommitdiff
path: root/pkg/rootless/rootless_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-04-12 18:08:26 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-04-12 18:20:40 +0200
commit814066ee3b6047c3a582d3bfb508895763379acb (patch)
tree71be9ccecd5fb4822b737a38a62976b15aadef6e /pkg/rootless/rootless_linux.go
parent531514e8231e7f42efb7e7992d62e516f9577363 (diff)
downloadpodman-814066ee3b6047c3a582d3bfb508895763379acb.tar.gz
podman-814066ee3b6047c3a582d3bfb508895763379acb.tar.bz2
podman-814066ee3b6047c3a582d3bfb508895763379acb.zip
rootless: do not block SIGTSTP
we were previously proxying all the signals, but doing that for SIGTSTP prevented the main process to be stopped by the tty. Closes: https://github.com/containers/libpod/issues/2775 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/rootless/rootless_linux.go')
-rw-r--r--pkg/rootless/rootless_linux.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go
index 1d1b1713d..2c99f41a4 100644
--- a/pkg/rootless/rootless_linux.go
+++ b/pkg/rootless/rootless_linux.go
@@ -28,6 +28,10 @@ extern int reexec_userns_join(int userns, int mountns);
*/
import "C"
+const (
+ numSig = 65 // max number of signals
+)
+
func runInUser() error {
os.Setenv("_CONTAINERS_USERNS_CONFIGURED", "done")
return nil
@@ -283,7 +287,15 @@ func BecomeRootInUserNS() (bool, int, error) {
c := make(chan os.Signal, 1)
- gosignal.Notify(c)
+ signals := []os.Signal{}
+ for sig := 0; sig < numSig; sig++ {
+ if sig == int(syscall.SIGTSTP) {
+ continue
+ }
+ signals = append(signals, syscall.Signal(sig))
+ }
+
+ gosignal.Notify(c, signals...)
defer gosignal.Reset()
go func() {
for s := range c {