Re: use_pty option is broken

"Todd C. Miller" <[email protected]> Wed, 06 Sep 2017 09:43:11 -0600
Newsgroups gmane.comp.tools.sudo.devel
Message-ID <[email protected]>
This only appeared to work in sudo 1.8.19p2.  If you run, for example:

    ssh root@localhost "sudo tty > /tmp/ttyname"

you'll find that the contents of /tmp/ttyname is "not a tty" in
both sudo versions.  In contrast:

    ssh -t root@localhost "tty > /tmp/ttyname"

shows that standard input is connected to a pty.

Previously, sudo would use a pipe to connect stdin, stdout and
stderr in this case.  As a fix for bug #786 it no longer does so:
    https://bugzilla.sudo.ws/show_bug.cgi?id=786

A goal for a future sudo release is to make use_pty the default
while matching the behavior of !use_pty as closely as possible.
The idea is to avoid the security issues that come from running
a command as another user on the same tty.

Rather than change the use_pty behavior I'd rather add a "fork_pty"
option if users want to force the use of a pty when a terminal is
not otherwise in use.

 - todd
____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-workers