We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fa1489 commit ac2e882Copy full SHA for ac2e882
src/node.cc
@@ -975,19 +975,16 @@ Local<Value> UVException(Isolate* isolate,
975
// Look up environment variable unless running as setuid root.
976
bool SafeGetenv(const char* key, std::string* text) {
977
#ifndef _WIN32
978
- if (getuid() != geteuid() || getgid() != getegid()) {
979
- text->clear();
980
- return false;
981
- }
+ if (linux_at_secure || getuid() != geteuid() || getgid() != getegid())
+ goto fail;
982
#endif
983
- if (linux_at_secure) {
984
985
986
+
987
if (const char* value = getenv(key)) {
988
*text = value;
989
return true;
990
}
+fail:
991
text->clear();
992
return false;
993
0 commit comments