|
version 1.1.1.1, 2012/02/21 16:23:02
|
version 1.1.1.2, 2012/05/29 12:26:49
|
|
Line 1
|
Line 1
|
| /* |
/* |
| * Copyright (c) 1993-1996, 1998-2005, 2007-2011 | * Copyright (c) 1993-1996, 1998-2005, 2007-2012 |
| * Todd C. Miller <Todd.Miller@courtesan.com> |
* Todd C. Miller <Todd.Miller@courtesan.com> |
| * |
* |
| * Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
|
Line 26
|
Line 26
|
| |
|
| #include <limits.h> |
#include <limits.h> |
| #include <pathnames.h> |
#include <pathnames.h> |
| |
#ifdef HAVE_STDBOOL_H |
| |
# include <stdbool.h> |
| |
#else |
| |
# include "compat/stdbool.h" |
| |
#endif /* HAVE_STDBOOL_H */ |
| |
|
| #include "missing.h" |
#include "missing.h" |
| #include "alloc.h" |
#include "alloc.h" |
| #include "error.h" |
#include "error.h" |
| #include "fileops.h" |
#include "fileops.h" |
| #include "list.h" |
#include "list.h" |
| |
#include "sudo_conf.h" |
| |
#include "sudo_debug.h" |
| #include "gettext.h" |
#include "gettext.h" |
| |
|
| #ifdef __TANDEM |
#ifdef __TANDEM |
|
Line 41
|
Line 48
|
| #endif |
#endif |
| |
|
| /* |
/* |
| * Pseudo-boolean values |
|
| */ |
|
| #undef TRUE |
|
| #define TRUE 1 |
|
| #undef FALSE |
|
| #define FALSE 0 |
|
| |
|
| /* |
|
| * Various modes sudo can be in (based on arguments) in hex |
* Various modes sudo can be in (based on arguments) in hex |
| */ |
*/ |
| #define MODE_RUN 0x00000001 |
#define MODE_RUN 0x00000001 |
|
Line 93
|
Line 92
|
| #define TGP_NOECHO_TRY 0x10 /* turn off echo if possible */ |
#define TGP_NOECHO_TRY 0x10 /* turn off echo if possible */ |
| |
|
| struct user_details { |
struct user_details { |
| |
pid_t pid; |
| |
pid_t ppid; |
| |
pid_t pgid; |
| |
pid_t tcpgid; |
| |
pid_t sid; |
| uid_t uid; |
uid_t uid; |
| uid_t euid; |
uid_t euid; |
| uid_t gid; |
uid_t gid; |
|
Line 134 struct command_details {
|
Line 138 struct command_details {
|
| int ngroups; |
int ngroups; |
| int closefrom; |
int closefrom; |
| int flags; |
int flags; |
| |
struct passwd *pw; |
| GETGROUPS_T *groups; |
GETGROUPS_T *groups; |
| const char *command; |
const char *command; |
| const char *cwd; |
const char *cwd; |
|
Line 164 void cleanup(int);
|
Line 169 void cleanup(int);
|
| /* tgetpass.c */ |
/* tgetpass.c */ |
| char *tgetpass(const char *, int, int); |
char *tgetpass(const char *, int, int); |
| int tty_present(void); |
int tty_present(void); |
| extern const char *askpass_path; |
|
| extern const char *noexec_path; |
|
| |
|
| /* zero_bytes.c */ |
/* zero_bytes.c */ |
| void zero_bytes(volatile void *, size_t); |
void zero_bytes(volatile void *, size_t); |
| |
|
| /* exec.c */ |
/* exec.c */ |
| int sudo_execve(struct command_details *details, struct command_status *cstat); | int sudo_execute(struct command_details *details, struct command_status *cstat); |
| void save_signals(void); |
void save_signals(void); |
| void restore_signals(void); |
void restore_signals(void); |
| |
|
|
Line 186 int term_restore(int, int);
|
Line 189 int term_restore(int, int);
|
| char *fmt_string(const char *var, const char *value); |
char *fmt_string(const char *var, const char *value); |
| |
|
| /* atobool.c */ |
/* atobool.c */ |
| int atobool(const char *str); | bool atobool(const char *str); |
| |
|
| /* parse_args.c */ |
/* parse_args.c */ |
| int parse_args(int argc, char **argv, int *nargc, char ***nargv, |
int parse_args(int argc, char **argv, int *nargc, char ***nargv, |
|
Line 200 int get_pty(int *master, int *slave, char *name, size_
|
Line 203 int get_pty(int *master, int *slave, char *name, size_
|
| void get_ttysize(int *rowp, int *colp); |
void get_ttysize(int *rowp, int *colp); |
| |
|
| /* sudo.c */ |
/* sudo.c */ |
| int exec_setup(struct command_details *details, const char *ptyname, int ptyfd); | bool exec_setup(struct command_details *details, const char *ptyname, int ptyfd); |
| | int policy_init_session(struct command_details *details); |
| int run_command(struct command_details *details); |
int run_command(struct command_details *details); |
| void sudo_debug(int level, const char *format, ...) __printflike(2, 3); |
|
| extern int debug_level; |
|
| extern const char *list_user, *runas_user, *runas_group; |
extern const char *list_user, *runas_user, *runas_group; |
| extern struct user_details user_details; |
extern struct user_details user_details; |
| |
|
|
Line 217 void usage(int);
|
Line 219 void usage(int);
|
| int selinux_restore_tty(void); |
int selinux_restore_tty(void); |
| int selinux_setup(const char *role, const char *type, const char *ttyn, |
int selinux_setup(const char *role, const char *type, const char *ttyn, |
| int ttyfd); |
int ttyfd); |
| void selinux_execve(const char *path, char *argv[], char *envp[]); | void selinux_execve(const char *path, char *const argv[], char *const envp[], |
| | int noexec); |
| |
|
| /* aix.c */ |
/* aix.c */ |
| void aix_prep_user(char *user, const char *tty); |
void aix_prep_user(char *user, const char *tty); |
| void aix_restoreauthdb(void); |
void aix_restoreauthdb(void); |
| void aix_setauthdb(char *user); |
void aix_setauthdb(char *user); |
| |
|
| |
/* hooks.c */ |
| |
/* XXX - move to sudo_plugin_int.h? */ |
| |
struct sudo_hook; |
| |
int register_hook(struct sudo_hook *hook); |
| |
int deregister_hook(struct sudo_hook *hook); |
| |
int process_hooks_getenv(const char *name, char **val); |
| |
int process_hooks_setenv(const char *name, const char *value, int overwrite); |
| |
int process_hooks_putenv(char *string); |
| |
int process_hooks_unsetenv(const char *name); |
| |
|
| /* interfaces.c */ |
/* interfaces.c */ |
| int get_net_ifs(char **addrinfo); |
int get_net_ifs(char **addrinfo); |
| |
|
| /* setgroups.c */ |
/* setgroups.c */ |
| int sudo_setgroups(int ngids, const GETGROUPS_T *gids); |
int sudo_setgroups(int ngids, const GETGROUPS_T *gids); |
| |
|
| |
/* ttyname.c */ |
| |
char *get_process_ttyname(void); |
| |
|
| #endif /* _SUDO_SUDO_H */ |
#endif /* _SUDO_SUDO_H */ |