On Wed, Mar 02, 2016 at 08:35:54PM +0100, Stanislav Brabec wrote: > Another possible fixes would be: > - Or create custom pty container (like script does). note that for pty container you have to call setsid() otherwise in session running shell has to control the terminal. ... > To prevent unwanted reading from a terminal, one would: > - Or create custom pty container (like script does). I'd like to cleanup all su(1) code, use signalfd and then add new features (for v2.30), because the current code is horrible from my point of view. Anyway, I have tried to implement experimental --pty option to the current code. See su-pty branch on github. (It's very raw...). The problem is again (like script(1)) non-terminal stdin and pty session mix echo AxA | su - kzak --pty -c "sed 's/x/A/'" this use-case is disabled for now. # tty /dev/pts/0 # runuser -u kzak tty /dev/pts/0 # runuser -u kzak --pty tty /dev/pts/4 Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html