[sudo-workers] use_pty option is broken

Radovan Sroka rsroka at redhat.com
Wed Sep 6 08:42:15 MDT 2017


Hi Todd,

it seems like use_pty option is broken here.

After some investigation I discovered that exec_pty() and pty_setup() is
called.
I can see "std{in,out,err} not a tty, not logging" in debug log but tty was
created in pty_setup().

I guess that is something wrong with this condition:

if (io_fds[SFD_STDOUT] == -1 || !isatty(STDOUT_FILENO)) {
         if (!interpose[STDOUT_FILENO]) {

This behavior was correct until 1.8.19p2.

*************************************************

Defaults !require_tty
Defaults use_pty

Run:
# ssh root at localhost sudo forker 2>&1     #it prints output but it shouldn't

*************************************************

Defaults !require_tty
Defaults !use_pty

Run:
# ssh root at localhost sudo forker 2>&1    #it prints output and it should

*************************************************

forker.sh
#!/bin/bash
for i in `seq 1 10`; do
    ( ping -c 10 -q www.redhat.com & )
done

-- 
--
---------------------------------------------------------

Radovan Sroka
Associate Software Engineer | Security Technologies | Red hat, Inc.


More information about the sudo-workers mailing list