Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
sudo
sudo-dont-enable-read-after-pty_finish.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sudo-dont-enable-read-after-pty_finish.patch of Package sudo
diff --git a/src/exec_pty.c b/src/exec_pty.c index c1ccd4b..7430137 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -748,12 +748,15 @@ write_callback(int fd, int what, void *v) if (sudo_ev_add(evbase, iob->wevent, NULL, false) == -1) sudo_fatal(U_("unable to add event to queue")); } - /* Enable reader if buffer is not full. */ - if (iob->revent != NULL && - (ttymode == TERM_RAW || !USERTTY_EVENT(iob->revent))) { - if (iob->len != sizeof(iob->buf)) { - if (sudo_ev_add(evbase, iob->revent, NULL, false) == -1) - sudo_fatal(U_("unable to add event to queue")); + /* + * Enable reader if buffer is not full but avoid reading /dev/tty + * if not in raw mode or the command is no longer running. + */ + if (iob->revent != NULL && iob->len != sizeof(iob->buf)) { + if (!USERTTY_EVENT(iob->revent) || + (ttymode == TERM_RAW && iob->ec->cmnd_pid != -1)) { + if (sudo_ev_add(evbase, iob->revent, NULL, false) == -1) + sudo_fatal(U_("unable to add event to queue")); } } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor