OpenVPN
|
#include "syshead.h"
#include "buffer.h"
#include "error.h"
#include "platform.h"
#include "win32.h"
#include "memdbg.h"
#include "run_command.h"
Go to the source code of this file.
Functions | |
int | script_security (void) |
void | script_security_set (int level) |
static const char * | system_error_message (int stat, struct gc_arena *gc) |
bool | openvpn_waitpid_check (pid_t pid, const char *msg_prefix, int msglevel) |
Checks if a running process is still running. | |
bool | openvpn_execve_allowed (const unsigned int flags) |
int | openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message) |
int | openvpn_popen (const struct argv *a, const struct env_set *es) |
Variables | |
static int | script_security_level = SSEC_BUILT_IN |
bool openvpn_execve_allowed | ( | const unsigned int | flags | ) |
Definition at line 151 of file run_command.c.
References S_SCRIPT, script_security(), SSEC_BUILT_IN, and SSEC_SCRIPTS.
Referenced by openvpn_execve().
int openvpn_execve_check | ( | const struct argv * | a, |
const struct env_set * | es, | ||
const unsigned int | flags, | ||
const char * | error_message | ||
) |
Definition at line 238 of file run_command.c.
References es, gc, gc_free(), gc_new(), M_FATAL, M_WARN, msg, openvpn_execve(), platform_ret_code(), platform_system_ok(), S_EXITCODE, S_FATAL, S_NOWAITPID, and system_error_message().
Referenced by add_route(), add_route_ipv6(), cleanup(), delete_route(), delete_route_ipv6(), do_ifconfig_ipv4(), do_ifconfig_ipv6(), exec_command(), init(), ipconfig_register_dns(), openvpn_run_script(), set_lladdr(), tun_afunix_exec_child(), undo_ifconfig_ipv4(), and undo_ifconfig_ipv6().
Definition at line 280 of file run_command.c.
References argv::argv, es, gc, gc_free(), gc_new(), M_ERR, M_FATAL, M_WARN, make_env_array(), msg, OPENVPN_EXECVE_FAILURE, script_security(), SCRIPT_SECURITY_WARNING, SSEC_BUILT_IN, SSEC_SCRIPTS, and status.
bool openvpn_waitpid_check | ( | pid_t | pid, |
const char * | msg_prefix, | ||
int | msglevel | ||
) |
Checks if a running process is still running.
This is mainly useful for processes started with S_NOWAITPID
This function is currently not implemented for Windows as the helper macros used by this function are not available.
pid | pid of the process to be checked |
msg_prefix | prefixed of the message that be printed |
msglevel | msglevel of the messages to be printed |
Definition at line 111 of file run_command.c.
References buffer::len, msg, OPENVPN_EXECVE_FAILURE, and status.
Referenced by read_tun_afunix(), tun_afunix_exec_child(), and write_tun_afunix().
int script_security | ( | void | ) |
Definition at line 43 of file run_command.c.
References script_security_level.
Referenced by do_option_warnings(), env_allowed(), openvpn_execve(), openvpn_execve_allowed(), and openvpn_popen().
void script_security_set | ( | int | level | ) |
Definition at line 49 of file run_command.c.
References script_security_level.
Referenced by add_option().
|
static |
Definition at line 58 of file run_command.c.
References alloc_buf_gc(), buf_printf(), buffer::data, gc, buffer::len, OPENVPN_EXECVE_ERROR, OPENVPN_EXECVE_FAILURE, and OPENVPN_EXECVE_NOT_ALLOWED.
Referenced by openvpn_execve_check().
|
static |
Definition at line 40 of file run_command.c.
Referenced by script_security(), and script_security_set().