termux-packages/packages/nodejs/src-node.cc.patch

38 lines
1.5 KiB
Diff
Raw Normal View History

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 @@
2015-09-09 01:18:52 +02:00
#include <unistd.h> // setuid, getuid
#endif
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
+#if defined(__POSIX__) && !defined(__CloudABI__)
2015-09-09 01:18:52 +02:00
#include <pwd.h> // getpwnam()
#include <grp.h> // getgrnam()
#endif
@@ -690,7 +690,7 @@
// 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);
-#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__)
2015-09-09 01:18:52 +02:00
}