OpenVPN
Data Structures | Functions
env_set.h File Reference
#include "argv.h"
#include "basic.h"
#include "buffer.h"
#include "common.h"
Include dependency graph for env_set.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  env_item
 
struct  env_set
 

Functions

void setenv_str_ex (struct env_set *es, const char *name, const char *value, const unsigned int name_include, const unsigned int name_exclude, const char name_replace, const unsigned int value_include, const unsigned int value_exclude, const char value_replace)
 
void setenv_counter (struct env_set *es, const char *name, counter_type value)
 
void setenv_int (struct env_set *es, const char *name, int value)
 
void setenv_long_long (struct env_set *es, const char *name, long long value)
 
void setenv_str (struct env_set *es, const char *name, const char *value)
 
void setenv_str_safe (struct env_set *es, const char *name, const char *value)
 
void setenv_del (struct env_set *es, const char *name)
 
void setenv_str_incr (struct env_set *es, const char *name, const char *value)
 Store the supplied name value pair in the env_set. More...
 
void setenv_int_i (struct env_set *es, const char *name, const int value, const int i)
 
void setenv_str_i (struct env_set *es, const char *name, const char *value, const int i)
 
struct env_setenv_set_create (struct gc_arena *gc)
 
void env_set_destroy (struct env_set *es)
 
bool env_set_del (struct env_set *es, const char *str)
 
void env_set_add (struct env_set *es, const char *str)
 
const char * env_set_get (const struct env_set *es, const char *name)
 
void env_set_print (int msglevel, const struct env_set *es)
 
void env_set_inherit (struct env_set *es, const struct env_set *src)
 
static bool is_password_env_var (const char *str)
 
static bool env_safe_to_print (const char *str)
 
bool env_allowed (const char *str)
 
const char ** make_env_array (const struct env_set *es, const bool check_allowed, struct gc_arena *gc)
 

Function Documentation

◆ env_allowed()

bool env_allowed ( const char *  str)

Definition at line 415 of file env_set.c.

References is_password_env_var(), script_security(), and SSEC_PW_ENV.

Referenced by env_block(), env_safe_to_print(), and make_env_array().

◆ env_safe_to_print()

static bool env_safe_to_print ( const char *  str)
inlinestatic

Definition at line 105 of file env_set.h.

References env_allowed(), env_set::gc, is_password_env_var(), and make_env_array().

Referenced by env_set_print(), and plugin_show_string_array().

◆ env_set_add()

void env_set_add ( struct env_set es,
const char *  str 
)

◆ env_set_create()

struct env_set* env_set_create ( struct gc_arena gc)

◆ env_set_del()

bool env_set_del ( struct env_set es,
const char *  str 
)

Definition at line 185 of file env_set.c.

References ASSERT, and env_set_del_nolock().

Referenced by setenv_str_ex(), and tls_x509_clear_env().

◆ env_set_destroy()

void env_set_destroy ( struct env_set es)

◆ env_set_get()

const char* env_set_get ( const struct env_set es,
const char *  name 
)

Definition at line 203 of file env_set.c.

References env_string_equal(), env_set::list, env_item::next, and env_item::string.

Referenced by setenv_str_incr().

◆ env_set_inherit()

void env_set_inherit ( struct env_set es,
const struct env_set src 
)

Definition at line 240 of file env_set.c.

References ASSERT, env_set_add_nolock(), env_set::list, env_item::next, and env_item::string.

Referenced by do_inherit_env().

◆ env_set_print()

void env_set_print ( int  msglevel,
const struct env_set es 
)

◆ is_password_env_var()

static bool is_password_env_var ( const char *  str)
inlinestatic

Definition at line 98 of file env_set.h.

Referenced by env_allowed(), and env_safe_to_print().

◆ make_env_array()

const char** make_env_array ( const struct env_set es,
const bool  check_allowed,
struct gc_arena gc 
)

◆ setenv_counter()

void setenv_counter ( struct env_set es,
const char *  name,
counter_type  value 
)

Definition at line 261 of file env_set.c.

References counter_format, openvpn_snprintf(), and setenv_str().

Referenced by setenv_stats().

◆ setenv_del()

void setenv_del ( struct env_set es,
const char *  name 
)

◆ setenv_int()

void setenv_int ( struct env_set es,
const char *  name,
int  value 
)

◆ setenv_int_i()

void setenv_int_i ( struct env_set es,
const char *  name,
const int  value,
const int  i 
)

Definition at line 397 of file env_set.c.

References gc_free(), gc_new(), setenv_format_indexed_name(), and setenv_int().

◆ setenv_long_long()

void setenv_long_long ( struct env_set es,
const char *  name,
long long  value 
)

◆ setenv_str()

void setenv_str ( struct env_set es,
const char *  name,
const char *  value 
)

◆ setenv_str_ex()

void setenv_str_ex ( struct env_set es,
const char *  name,
const char *  value,
const unsigned int  name_include,
const unsigned int  name_exclude,
const char  name_replace,
const unsigned int  value_include,
const unsigned int  value_exclude,
const char  value_replace 
)

◆ setenv_str_i()

void setenv_str_i ( struct env_set es,
const char *  name,
const char *  value,
const int  i 
)

Definition at line 406 of file env_set.c.

References gc_free(), gc_new(), setenv_format_indexed_name(), and setenv_str().

Referenced by setenv_connection_entry().

◆ setenv_str_incr()

void setenv_str_incr ( struct env_set es,
const char *  name,
const char *  value 
)

Store the supplied name value pair in the env_set.

If the variable with the supplied name already exists, append _N to the name, starting at N=1.

Definition at line 307 of file env_set.c.

References ASSERT, D_TLS_DEBUG_MED, env_set_get(), free, gc_malloc(), msg, openvpn_snprintf(), and setenv_str().

Referenced by x509_setenv().

◆ setenv_str_safe()

void setenv_str_safe ( struct env_set es,
const char *  name,
const char *  value 
)

Definition at line 291 of file env_set.c.

References BSTR, buf_printf(), buf_set_write(), M_WARN, msg, and setenv_str().

Referenced by add_option().