Skip to content
API Documentation
BastionGuard™
anonymous_namespace{dns_secure.cpp} Namespace Reference

Classes

struct  BwrapArgs

Functions

static bool path_safe (const char *p)
static bool path_exists (const std::string &p)

Function Documentation

◆ path_exists()

bool anonymous_namespace{dns_secure.cpp}::path_exists ( const std::string & p)
static

Definition at line 104 of file dns_secure.cpp.

104 {
105 struct stat st{};
106 return ::stat(p.c_str(), &st) == 0;
107}

References path_exists().

Referenced by path_exists(), and reexec_inside_bwrap_with_custom_dns().

◆ path_safe()

bool anonymous_namespace{dns_secure.cpp}::path_safe ( const char * p)
static

Definition at line 96 of file dns_secure.cpp.

96 {
97 if (!p || !*p) return false;
98 if (p[0] != '/') return false;
99 if (std::strchr(p, '\n')) return false;
100 if (std::strchr(p, '\r')) return false;
101 return true;
102}

References path_safe().

Referenced by path_safe(), and reexec_inside_bwrap_with_custom_dns().