Skip to content

sudo-1.9.15 fails to restore tty settings on some shells #326

@rajeevvp

Description

@rajeevvp

sudo-1.9.15 doesn't seem to be restoring the tty settings correctly. Start a new xterm instance so that you get a new PTY (this is important--if you fix the terminal using a ^Jstty sane^J then sudo keeps working correctly on the same PTY). Then, if the shell is bash(1) and with the new sudo from the latest quarterly:

$ uname -a
FreeBSD x202e 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64
$ sudo --version
Sudo version 1.9.15
Sudoers policy plugin version 1.9.15
Sudoers file grammar version 50
Sudoers I/O plugin version 1.9.15
Sudoers audit plugin version 1.9.15
$ echo $BASH_VERSION
5.2.15(0)-release
$ sudo echo hello
Password
hello
$ printf 'hello\nworld\n'                    # type blind because ECHO is off
hello
     world
          $                                  # notice stair-stepped effect. stty(1) indicates raw mode

The situation is much worse with dash(1) and ksh93. The system /bin/sh seems OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions