2017-01-09 23:30:11 +01:00
|
|
|
Without this patch functions such as process.getgroups
|
|
|
|
are not built on Android, which breaks things such as
|
|
|
|
npm/node_modules/which/which.js.
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
diff -u -r ../node-v9.1.0/src/node.cc ./src/node.cc
|
|
|
|
--- ../node-v9.1.0/src/node.cc 2017-11-07 16:08:24.000000000 +0100
|
|
|
|
+++ ./src/node.cc 2017-11-11 19:19:05.080439199 +0100
|
|
|
|
@@ -108,7 +108,7 @@
|
2017-01-09 23:30:11 +01:00
|
|
|
#include <unistd.h> // setuid, getuid
|
|
|
|
#endif
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
2017-01-09 23:30:11 +01:00
|
|
|
#include <pwd.h> // getpwnam()
|
|
|
|
#include <grp.h> // getgrnam()
|
|
|
|
#endif
|
2017-11-11 19:26:14 +01:00
|
|
|
@@ -2122,7 +2122,7 @@
|
2017-01-09 23:30:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
2017-01-09 23:30:11 +01:00
|
|
|
|
|
|
|
static const uid_t uid_not_found = static_cast<uid_t>(-1);
|
|
|
|
static const gid_t gid_not_found = static_cast<gid_t>(-1);
|
2017-11-11 19:26:14 +01:00
|
|
|
@@ -2441,7 +2441,7 @@
|
2017-01-09 23:30:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#endif // __POSIX__ && !defined(__CloudABI__)
|
2017-01-09 23:30:11 +01:00
|
|
|
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
static void WaitForInspectorDisconnect(Environment* env) {
|
|
|
|
@@ -3711,7 +3711,7 @@
|
2017-01-09 23:30:11 +01:00
|
|
|
|
|
|
|
env->SetMethod(process, "umask", Umask);
|
|
|
|
|
2017-11-11 19:26:14 +01:00
|
|
|
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#if defined(__POSIX__) && !defined(__CloudABI__)
|
2017-01-09 23:30:11 +01:00
|
|
|
env->SetMethod(process, "getuid", GetUid);
|
|
|
|
env->SetMethod(process, "geteuid", GetEUid);
|
|
|
|
env->SetMethod(process, "setuid", SetUid);
|
2017-11-11 19:26:14 +01:00
|
|
|
@@ -3725,7 +3725,7 @@
|
2017-01-09 23:30:11 +01:00
|
|
|
env->SetMethod(process, "getgroups", GetGroups);
|
|
|
|
env->SetMethod(process, "setgroups", SetGroups);
|
|
|
|
env->SetMethod(process, "initgroups", InitGroups);
|
2017-11-11 19:26:14 +01:00
|
|
|
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
|
|
|
|
+#endif // __POSIX__ && !defined(__CloudABI__)
|
2017-01-09 23:30:11 +01:00
|
|
|
|
|
|
|
env->SetMethod(process, "_kill", Kill);
|
|
|
|
|