diff options
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/node.cc b/src/node.cc index 85b4b1264a5..c3a78b30153 100644 --- a/src/node.cc +++ b/src/node.cc @@ -230,6 +230,8 @@ bool config_expose_internals = false; bool v8_initialized = false; +bool linux_at_secure = false; + // process-relative uptime base, initialized at start-up static double prog_start_time; @@ -965,13 +967,15 @@ Local<Value> UVException(Isolate* isolate, // Look up environment variable unless running as setuid root. bool SafeGetenv(const char* key, std::string* text) { #ifndef _WIN32 - // TODO(bnoordhuis) Should perhaps also check whether getauxval(AT_SECURE) - // is non-zero on Linux. if (getuid() != geteuid() || getgid() != getegid()) { text->clear(); return false; } #endif + if (linux_at_secure) { + text->clear(); + return false; + } if (const char* value = getenv(key)) { *text = value; return true; |