OpenVPN
Functions
check_file_access.h File Reference
#include "options.h"
Include dependency graph for check_file_access.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool check_cmd_access (const char *command, const char *opt, const char *chroot)
 Verifies that the path in the "command" that comes after certain script options (e.g., –up) is a valid file with appropriate permissions.
 
void options_postprocess_filechecks (struct options *options)
 Sanity check of all file/dir options.
 

Function Documentation

◆ check_cmd_access()

bool check_cmd_access ( const char *  command,
const char *  opt,
const char *  chroot 
)

Verifies that the path in the "command" that comes after certain script options (e.g., –up) is a valid file with appropriate permissions.

"command" consists of a path, optionally followed by a space, which may be followed by arbitrary arguments. It is NOT a full shell command line – shell expansion is not performed.

The path and arguments in "command" may be single- or double-quoted or escaped.

The path is extracted from "command", then check_file_access() is called to check it. The arguments, if any, are ignored.

Note that the type, mode, and opt arguments to this routine are the same as the corresponding check_file_access() arguments.

Definition at line 214 of file check_file_access.c.

References argv::argv, argv_free(), argv_new(), argv_parse_cmd(), check_file_access_chroot(), CHKACC_FILE, M_NOPREFIX, M_OPTERR, and msg.

Referenced by set_user_script().

◆ options_postprocess_filechecks()

void options_postprocess_filechecks ( struct options options)

Sanity check of all file/dir options.

Checks that file/dir is accessible by OpenVPN

Definition at line 250 of file check_file_access.c.

References connection_list::array, ASSERT, options::auth_user_pass_file, options::auth_user_pass_file_inline, options::ca_file, options::ca_file_inline, options::ca_path, options::cert_file, options::cert_file_inline, check_file_access(), check_file_access_chroot(), check_file_access_chroot_inline(), check_file_access_inline(), CHKACC_ACCEPT_URI, CHKACC_ACPTSTDIN, CHKACC_DIRPATH, CHKACC_FILE, CHKACC_FILEXSTWR, CHKACC_PRIVATE, options::chroot_dir, options::client_config_dir, options::connection_list, options::crl_file, options::crl_file_inline, options::dh_file, options::dh_file_inline, options::extra_certs_file, options::key_pass_file, connection_list::len, M_USAGE, options::management_flags, options::management_user_pass, MF_EXTERNAL_KEY, msg, options::packet_id_file, options::pkcs12_file, options::pkcs12_file_inline, options::priv_key_file, options::priv_key_file_inline, options::shared_secret_file, options::shared_secret_file_inline, options::ssl_flags, SSLF_CRL_VERIFY_DIR, options::status_file, connection_entry::tls_auth_file, connection_entry::tls_auth_file_inline, connection_entry::tls_crypt_file, connection_entry::tls_crypt_file_inline, connection_entry::tls_crypt_v2_file, connection_entry::tls_crypt_v2_file_inline, options::tls_export_peer_cert_dir, options::tmp_dir, options::verify_hash_no_ca, and options::writepid.

Referenced by options_postprocess().