OpenVPN
Functions | Variables
run_command.c File Reference
#include "syshead.h"
#include "buffer.h"
#include "error.h"
#include "platform.h"
#include "win32.h"
#include "memdbg.h"
#include "run_command.h"
Include dependency graph for run_command.c:

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
 

Function Documentation

◆ openvpn_execve_allowed()

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().

◆ openvpn_execve_check()

int openvpn_execve_check ( const struct argv a,
const struct env_set es,
const unsigned int  flags,
const char *  error_message 
)

◆ openvpn_popen()

int openvpn_popen ( const struct argv a,
const struct env_set es 
)

◆ openvpn_waitpid_check()

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.

Parameters
pidpid of the process to be checked
msg_prefixprefixed of the message that be printed
msglevelmsglevel of the messages to be printed
Returns
true if the process is still running, false if an error condition occurred

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().

◆ script_security()

int script_security ( void  )

◆ script_security_set()

void script_security_set ( int  level)

Definition at line 49 of file run_command.c.

References script_security_level.

Referenced by add_option().

◆ system_error_message()

static const char * system_error_message ( int  stat,
struct gc_arena gc 
)
static

Variable Documentation

◆ script_security_level

int script_security_level = SSEC_BUILT_IN
static

Definition at line 40 of file run_command.c.

Referenced by script_security(), and script_security_set().