-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sudo-1.9.15 fails to restore tty settings on some shells #326
Comments
Does this only happen when sudo prompts for a password or does it always occur? |
Unfortunately I'm unable to reproduce this on FreeBSD 13.2 inside a VM, even from an xterm. Can you try adding the following to /usr/local/etc/sudo.conf?
and paste the lines between the begin and end of sudo_term_restore_v1? When it is working correctly it should look like:
I suspect in your case that it is failing and there will also be a line like:
though it could be c_iflag, c_oflag, c_cflag or c_cc[] that have changed. |
OK, I've figured out what's going on here. Do I'll close this issue, as I've got the fix; and I'll ping Tom Dickey about this. |
This is actually a sudo bug. Sudo is calling tcsetattr() with the TCSASOFT flag which causes c_cflag to be ignored, but then it expects the changed value of c_cflag to be present when it reads it back later. |
If TCSASOFT is present, tcsetattr() will ignore c_cflag. Fixes a bug where sudo_term_restore() would refuse to change the terminal settings back if the PARENB control flag was set. GitHub issue #326.
This is fixed in sudo 1.9.15p2. |
Thanks! |
sudo-1.9.15
doesn't seem to be restoring the tty settings correctly. Start a newxterm
instance so that you get a new PTY (this is important--if you fix the terminal using a^Jstty sane^J
thensudo
keeps working correctly on the same PTY). Then, if the shell isbash(1)
and with the newsudo
from the latest quarterly:The situation is much worse with
dash(1)
andksh93
. The system/bin/sh
seems OK.The text was updated successfully, but these errors were encountered: