Convert the main sudo event loop to use the event subsystem.

Read events for I/O buffers are added before the loop starts.
Write events are added on demand as the buffers are filled.
This commit is contained in:
Todd C. Miller
2013-10-12 05:53:52 -06:00
parent 79acd5db49
commit 83d2d25c4c
3 changed files with 685 additions and 472 deletions

View File

@@ -45,18 +45,18 @@
*/
/* exec.c */
struct sudo_event_base;
int sudo_execve(const char *path, char *const argv[], char *const envp[], int noexec);
extern volatile pid_t cmnd_pid;
/* exec_pty.c */
struct command_details;
struct command_status;
int fork_pty(struct command_details *details, int sv[], int *maxfd, sigset_t *omask);
int perform_io(fd_set *fdsr, fd_set *fdsw, struct command_status *cstat);
int fork_pty(struct command_details *details, int sv[], sigset_t *omask);
int suspend_parent(int signo);
void exec_cmnd(struct command_details *details, struct command_status *cstat,
int *errfd);
void fd_set_iobs(fd_set *fdsr, fd_set *fdsw);
void add_io_events(struct sudo_event_base *evbase);
#ifdef SA_SIGINFO
void handler(int s, siginfo_t *info, void *context);
#else