2018-12-28 10:58:26 +01:00
|
|
|
diff -u -r ../node-v10.9.0/src/node.cc ./src/node.cc
|
|
|
|
--- ../node-v10.9.0/src/node.cc 2018-08-15 13:53:34.000000000 +0000
|
|
|
|
+++ ./src/node.cc 2018-08-23 20:49:59.353995878 +0000
|
|
|
|
@@ -106,7 +106,7 @@
|
2018-09-11 23:51:55 +02:00
|
|
|
#include <unistd.h> // setuid, getuid
|
|
|
|
#endif
|
|
|
|
|
2018-12-28 10:58:26 +01:00
|
|
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
2018-09-11 23:51:55 +02:00
|
|
|
#include <pwd.h> // getpwnam()
|
|
|
|
#include <grp.h> // getgrnam()
|
|
|
|
#endif
|
2018-12-28 10:58:26 +01:00
|
|
|
@@ -690,7 +690,7 @@
|
2018-09-11 23:51:55 +02:00
|
|
|
|
2018-12-28 10:58:26 +01:00
|
|
|
// Look up environment variable unless running as setuid root.
|
|
|
|
bool SafeGetenv(const char* key, std::string* text) {
|
|
|
|
-#if !defined(__CloudABI__) && !defined(_WIN32)
|
|
|
|
+#if !defined(__CloudABI__) && !defined(_WIN32) && !defined(__ANDROID__)
|
|
|
|
if (linux_at_secure || getuid() != geteuid() || getgid() != getegid())
|
|
|
|
goto fail;
|
|
|
|
#endif
|
|
|
|
@@ -2402,13 +2402,13 @@
|
|
|
|
env->SetMethod(process, "reallyExit", Exit);
|
|
|
|
env->SetMethodNoSideEffect(process, "uptime", Uptime);
|
2018-09-11 23:51:55 +02:00
|
|
|
|
2018-12-28 10:58:26 +01:00
|
|
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
|
|
|
env->SetMethodNoSideEffect(process, "getuid", GetUid);
|
|
|
|
env->SetMethodNoSideEffect(process, "geteuid", GetEUid);
|
|
|
|
env->SetMethodNoSideEffect(process, "getgid", GetGid);
|
|
|
|
env->SetMethodNoSideEffect(process, "getegid", GetEGid);
|
|
|
|
env->SetMethodNoSideEffect(process, "getgroups", GetGroups);
|
|
|
|
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#endif // __POSIX__ && !defined(__CloudABI__)
|
|
|
|
}
|
2018-09-11 23:51:55 +02:00
|
|
|
|
|
|
|
|