2010-06-16 16:46:56 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SUDO_EXEC_H
|
|
|
|
#define _SUDO_EXEC_H
|
|
|
|
|
2011-02-03 09:59:41 -05:00
|
|
|
/*
|
|
|
|
* Special values to indicate whether continuing in foreground or background.
|
|
|
|
*/
|
|
|
|
#define SIGCONT_FG -2
|
|
|
|
#define SIGCONT_BG -3
|
|
|
|
|
2010-06-16 16:46:56 -04:00
|
|
|
/*
|
|
|
|
* Symbols shared between exec.c and exec_pty.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* exec.c */
|
|
|
|
int my_execve(const char *path, char *const argv[], char *const envp[]);
|
2010-09-10 11:20:32 -04:00
|
|
|
int pipe_nonblock(int fds[2]);
|
2010-06-16 16:46:56 -04:00
|
|
|
|
|
|
|
/* exec_pty.c */
|
2011-03-10 14:24:10 -05:00
|
|
|
int fork_pty(struct command_details *details, int sv[], int *maxfd);
|
2010-06-16 16:46:56 -04:00
|
|
|
int perform_io(fd_set *fdsr, fd_set *fdsw, struct command_status *cstat);
|
|
|
|
int suspend_parent(int signo);
|
|
|
|
void fd_set_iobs(fd_set *fdsr, fd_set *fdsw);
|
|
|
|
void handler(int s);
|
|
|
|
void pty_close(struct command_status *cstat);
|
2011-03-08 15:37:40 -05:00
|
|
|
void pty_setup(uid_t uid, const char *tty);
|
2010-06-16 16:46:56 -04:00
|
|
|
void terminate_child(pid_t pid, int use_pgrp);
|
2010-09-10 11:20:32 -04:00
|
|
|
extern int signal_pipe[2];
|
2010-06-16 16:46:56 -04:00
|
|
|
|
|
|
|
#endif /* _SUDO_EXEC_H */
|