MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / resolveExePath

Function resolveExePath

src/helper/linux/utils.cpp:87–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool resolveExePath(const std::string &exePath, const std::string &executable, std::string &outPath)
88{
89 char *canonicalPath = realpath(exePath.c_str(), NULL);
90 if (!canonicalPath) {
91 spdlog::warn("Executable not in valid path, ignoring.");
92 return false;
93 }
94
95// check only for non-dev builds
96#ifndef WINDSCRIBE_DEV_MODE
97 if (strcmp(canonicalPath, WS_LINUX_INSTALL_DIR) != 0 && strcmp(canonicalPath, "/usr/lib" WS_LINUX_INSTALL_DIR) != 0) {
98 // Don't execute arbitrary commands, only executables that are in our application directory
99 spdlog::warn("Executable not in correct path, ignoring.");
100 free(canonicalPath);
101 return false;
102 }
103#endif
104
105 outPath = std::string(canonicalPath) + "/" + executable;
106 free(canonicalPath);
107 return true;
108}
109
110std::vector<std::string> getOpenVpnExeNames()
111{

Callers 5

executeOpenVPNFunction · 0.70
startCtrldFunction · 0.70
startStunnelFunction · 0.70
startWstunnelFunction · 0.70
startMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected