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 413 of file env_set.c.

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

Referenced by env_block(), 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 is_password_env_var().

Referenced by env_set_print(), and plugin_show_string_array().

◆ env_set_add()

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

Definition at line 193 of file env_set.c.

References ASSERT, env_set_add_nolock(), and es.

Referenced by do_ifconfig_ipv4(), do_ifconfig_ipv6(), output_peer_info_env(), and setenv_str_ex().

◆ 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 183 of file env_set.c.

References ASSERT, env_set_del_nolock(), and es.

Referenced by setenv_str_ex(), tls_x509_clear_env(), and verify_cert_cert_delete_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 201 of file env_set.c.

References env_string_equal(), es, 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 238 of file env_set.c.

References ASSERT, env_set_add_nolock(), es, 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 259 of file env_set.c.

References counter_format, es, 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 395 of file env_set.c.

References es, 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 
)

Definition at line 275 of file env_set.c.

References es, and setenv_str().

Referenced by multi_client_connect_setenv(), multi_client_disconnect_setenv(), and setenv_settings().

◆ 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 404 of file env_set.c.

References es, 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 305 of file env_set.c.

References ASSERT, D_TLS_DEBUG_MED, env_set_get(), es, gc_malloc(), msg, 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 289 of file env_set.c.

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

Referenced by add_option().