--- embedaddon/sudo/src/sudo_exec.h 2012/02/21 16:23:02 1.1 +++ embedaddon/sudo/src/sudo_exec.h 2014/06/15 16:12:55 1.1.1.5 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Todd C. Miller + * Copyright (c) 2010-2013 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,33 +18,64 @@ #define _SUDO_EXEC_H /* + * Older systems may not support MSG_WAITALL but it shouldn't really be needed. + */ +#ifndef MSG_WAITALL +# define MSG_WAITALL 0 +#endif + +/* * Special values to indicate whether continuing in foreground or background. */ #define SIGCONT_FG -2 #define SIGCONT_BG -3 /* + * Positions in saved_signals[] + */ +#define SAVED_SIGALRM 0 +#define SAVED_SIGCHLD 1 +#define SAVED_SIGCONT 2 +#define SAVED_SIGHUP 3 +#define SAVED_SIGINT 4 +#define SAVED_SIGPIPE 5 +#define SAVED_SIGQUIT 6 +#define SAVED_SIGTERM 7 +#define SAVED_SIGTSTP 8 +#define SAVED_SIGTTIN 9 +#define SAVED_SIGTTOU 10 +#define SAVED_SIGUSR1 11 +#define SAVED_SIGUSR2 12 + +/* * Symbols shared between exec.c and exec_pty.c */ /* exec.c */ -int my_execve(const char *path, char *const argv[], char *const envp[]); -int pipe_nonblock(int fds[2]); +struct sudo_event_base; +int sudo_execve(const char *path, char *const argv[], char *const envp[], bool noexec); +extern volatile pid_t cmnd_pid; /* exec_pty.c */ -int fork_pty(struct command_details *details, int sv[], int *maxfd); -int perform_io(fd_set *fdsr, fd_set *fdsw, struct command_status *cstat); +struct command_details; +struct command_status; +int fork_pty(struct command_details *details, int sv[], sigset_t *omask); int suspend_parent(int signo); -void fd_set_iobs(fd_set *fdsr, fd_set *fdsw); +void exec_cmnd(struct command_details *details, struct command_status *cstat, + int errfd); +void add_io_events(struct sudo_event_base *evbase); +#ifdef SA_SIGINFO +void handler(int s, siginfo_t *info, void *context); +#else void handler(int s); +#endif void pty_close(struct command_status *cstat); void pty_setup(uid_t uid, const char *tty, const char *utmp_user); -void terminate_child(pid_t pid, int use_pgrp); -extern int signal_pipe[2]; +void terminate_command(pid_t pid, bool use_pgrp); /* utmp.c */ -int utmp_login(const char *from_line, const char *to_line, int ttyfd, +bool utmp_login(const char *from_line, const char *to_line, int ttyfd, const char *user); -int utmp_logout(const char *line, int status); +bool utmp_logout(const char *line, int status); #endif /* _SUDO_EXEC_H */