Back out WIP code that was mistakenly committed.

This commit is contained in:
Todd C. Miller
2020-06-01 14:04:15 -06:00
parent a0aaae5541
commit de31e6d53b

View File

@@ -110,7 +110,7 @@ static void del_io_events(bool nonblocking);
static void sync_ttysize(struct exec_closure_pty *ec);
static int safe_close(int fd);
static void ev_free_by_fd(struct sudo_event_base *evbase, int fd);
static pid_t check_foreground(struct exec_closure_pty *ec);
static void check_foreground(struct exec_closure_pty *ec);
static void add_io_events(struct sudo_event_base *evbase);
static void schedule_signal(struct exec_closure_pty *ec, int signo);
@@ -487,25 +487,22 @@ log_winchange(unsigned int rows, unsigned int cols)
/*
* Check whether we are running in the foregroup.
* Updates the foreground global and updates the window size.
* Returns 0 if there is no tty, the foreground process group ID
* on success, or -1 on failure (tty revoked).
* Updates the foreground global and does lazy init of the
* the pty slave as needed.
*/
static pid_t
static void
check_foreground(struct exec_closure_pty *ec)
{
int ret = 0;
debug_decl(check_foreground, SUDO_DEBUG_EXEC);
if (io_fds[SFD_USERTTY] != -1) {
if ((ret = tcgetpgrp(io_fds[SFD_USERTTY])) != -1) {
foreground = ret == ec->ppgrp;
foreground = tcgetpgrp(io_fds[SFD_USERTTY]) == ec->ppgrp;
/* Also check for window size changes. */
sync_ttysize(ec);
}
/* Also check for window size changes. */
sync_ttysize(ec);
}
debug_return_int(ret);
debug_return;
}
/*
@@ -571,7 +568,6 @@ suspend_sudo(struct exec_closure_pty *ec, int signo)
log_suspend(SIGCONT);
/* Check foreground/background status on resume. */
/* XXX - handle missing tty */
check_foreground(ec);
/*