48#define CHKACC_FILE (1 << 0)
49#define CHKACC_DIRPATH (1 << 1)
50#define CHKACC_FILEXSTWR (1 << 2)
51#define CHKACC_ACPTSTDIN (1 << 3)
52#define CHKACC_PRIVATE (1 << 4)
53#define CHKACC_ACCEPT_URI (1 << 5)
79 if (!strncmp(file,
"file:", 5))
83 else if (!strchr(file,
'/') || strchr(file,
'/') > strchr(file,
':'))
94 const char *dirpath =
dirname(fullpath);
129 if (st.st_mode & (S_IRWXG | S_IRWXO))
131 msg(
M_WARN,
"WARNING: file '%s' is group or others accessible", file);
144 return (errcode != 0 ?
true :
false);
187 const char *file,
const int mode,
const char *opt)
286 R_OK | X_OK,
"--crl-verify directory");
320 R_OK | W_OK,
"--replay-persist");
325#ifdef ENABLE_MANAGEMENT
344 R_OK | X_OK,
"--client-config-dir");
346 R_OK | W_OK | X_OK,
"Temporary directory (--tmp-dir)");
void argv_parse_cmd(struct argv *argres, const char *cmdstr)
Parses a command string, tokenizes it and puts each element into a separate struct argv argument slot...
void argv_free(struct argv *a)
Frees all memory allocations allocated by the struct argv related functions.
struct argv argv_new(void)
Allocates a new struct argv and ensures it is initialised.
char * string_alloc(const char *str, struct gc_arena *gc)
Duplicate a string, allocating memory under garbage collection.
Buffer management functions and garbage collection.
#define BSTR(buf)
Return the buffer content pointer cast to char *.
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
#define CHKACC_PRIVATE
Warn if this (private) file is group/others accessible.
static bool check_file_access_chroot_inline(bool is_inline, const char *chroot, const int type, const char *file, const int mode, const char *opt)
A wrapper for check_file_access_chroot() that returns false immediately if the file is inline (and th...
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....
static bool check_file_access_chroot(const char *chroot, const int type, const char *file, const int mode, const char *opt)
A wrapper for check_file_access() which also takes a chroot directory.
#define CHKACC_DIRPATH
Check for directory presence where a file should reside.
#define CHKACC_ACPTSTDIN
If filename is stdin, it's allowed and "exists".
void options_postprocess_filechecks(struct options *options)
Sanity check of all file/dir options.
#define CHKACC_FILEXSTWR
If file exists, is it writable?
static bool check_file_access_inline(bool is_inline, const int type, const char *file, const int mode, const char *opt)
A wrapper for check_file_access() that returns false immediately if the file is inline (and therefore...
#define CHKACC_ACCEPT_URI
Do not check URIs, unless they start with file:
static bool check_file_access(const int type, const char *file, const int mode, const char *opt)
#define CHKACC_FILE
Check for a file/directory presence.
char * dirname(char *path)
struct buffer prepend_dir(const char *dir, const char *path, struct gc_arena *gc)
Prepend a directory to a path.
Control Channel Common Data Structures.
#define SSLF_CRL_VERIFY_DIR
Wrapper structure for dynamically allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
const char * tls_crypt_file
const char * tls_crypt_v2_file
bool tls_crypt_file_inline
bool tls_auth_file_inline
const char * tls_auth_file
bool tls_crypt_v2_file_inline
struct connection_entry ** array
Garbage collection arena used to keep track of dynamically allocated memory.
struct connection_list * connection_list
const char * tls_export_peer_cert_dir
const char * packet_id_file
const char * key_pass_file
unsigned int management_flags
const char * auth_user_pass_file
const char * extra_certs_file
bool priv_key_file_inline
bool auth_user_pass_file_inline
bool shared_secret_file_inline
const char * priv_key_file
const char * management_user_pass
const char * shared_secret_file
const char * client_config_dir