Use secure_getenv() when building using Emscripten
This commit is contained in:
@@ -47,7 +47,7 @@ static int setBasePathInCluster(char **pBasePath)
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
const char *service_host_env = getenv(SERVICE_HOST_ENV_NAME);
|
||||
#elif __linux
|
||||
#elif __linux || defined(__EMSCRIPTEN__)
|
||||
const char *service_host_env = secure_getenv(SERVICE_HOST_ENV_NAME);
|
||||
#endif
|
||||
if (!service_host_env) {
|
||||
@@ -56,7 +56,7 @@ static int setBasePathInCluster(char **pBasePath)
|
||||
}
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
const char *service_port_env = getenv(SERVICE_PORT_ENV_NAME);
|
||||
#elif __linux
|
||||
#elif __linux || defined(__EMSCRIPTEN__)
|
||||
const char *service_port_env = secure_getenv(SERVICE_PORT_ENV_NAME);
|
||||
#endif
|
||||
if (!service_port_env) {
|
||||
|
||||
@@ -113,7 +113,7 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
kubeconfig_env = getenv(ENV_KUBECONFIG);
|
||||
#elif __linux
|
||||
#elif __linux || defined(__EMSCRIPTEN__)
|
||||
kubeconfig_env = secure_getenv(ENV_KUBECONFIG);
|
||||
#endif
|
||||
if (kubeconfig_env) {
|
||||
@@ -121,7 +121,7 @@ static char *getWorkingConfigFile(const char *configFileNamePassedIn)
|
||||
} else {
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__APPLE__)
|
||||
homedir_env = getenv(ENV_HOME);
|
||||
#elif __linux
|
||||
#elif __linux || defined(__EMSCRIPTEN__)
|
||||
homedir_env = secure_getenv(ENV_HOME);
|
||||
#else
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user