node/src/node.cc
// Look up environment variable unless running as setuid root.
Look up environment variable unless running as setuid root.
Look up environment variable unless running as setuid root .
bool SafeGetenv(const char* key, std::string* text) {
#ifndef _WIN32
  if (linux_at_secure || getuid() != geteuid() || getgid() != getegid())
    goto fail;
#endif
  if (const char* value = getenv(key)) {
    *text = value;
    return true;
  }
fail:
  text->clear();
  return false;
}
bool SafeGetenv ( const char * key , std :: string * text ) { #ifndef _WIN32 if ( linux_at_secure || getuid ( ) != geteuid ( ) || getgid ( ) != getegid ( ) ) goto fail ; #endif if ( const char * value = getenv ( key ) ) { * text = value ; return true ; } fail : text -> clear ( ) ; return false ; }
Look up environment variable unless running as setuid root.
Look up environment variable unless running as setuid root .