sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.2k stars 224 forks source link

Using pipe on rootless container output hangs with use_pty enabled #403

Open groovyfeng opened 3 months ago

groovyfeng commented 3 months ago

With Podman, sudo can be used to run a container in the context of a non-root user (rootless). e.g. sudo -iu testuser podman run -it busybox echo test With use_pty enabled, ff the output is piped to another command then it hangs, irresponsive to ctrl+c. sudo -iu testuser podman run -it busybox echo test | cat The hanging won't happen if use_pty is disabled or sudo is not used. The deadlock seems to happen with the combination of rootless container and piping. It can be repro'd on Red Hat 8 & 9, the sudo version is 1.9.5p2.