Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2020-04-21 21:57:16 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2020-07-18 06:23:21 +0300
commit7a447bcd54f5e153d14da377963541349d7bda09 (patch)
treef2a91589e92c88d10c2a73919847a5c056599089 /src/node_credentials.cc
parentb1c3909bd766327a569c2e4279a4670454f3f9db (diff)
src: snapshot node
This runs `lib/internal/bootstrap/node.js` before creating the builtin snapshot and deserialize the loaders from the snapshot in deserialization mode. PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src/node_credentials.cc')
-rw-r--r--src/node_credentials.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/node_credentials.cc b/src/node_credentials.cc
index 83db705e10d..acc48cac3c9 100644
--- a/src/node_credentials.cc
+++ b/src/node_credentials.cc
@@ -1,4 +1,5 @@
#include "env-inl.h"
+#include "node_external_reference.h"
#include "node_internals.h"
#include "util-inl.h"
@@ -371,6 +372,25 @@ static void InitGroups(const FunctionCallbackInfo<Value>& args) {
#endif // NODE_IMPLEMENTS_POSIX_CREDENTIALS
+void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
+ registry->Register(SafeGetenv);
+
+#ifdef NODE_IMPLEMENTS_POSIX_CREDENTIALS
+ registry->Register(GetUid);
+ registry->Register(GetEUid);
+ registry->Register(GetGid);
+ registry->Register(GetEGid);
+ registry->Register(GetGroups);
+
+ registry->Register(InitGroups);
+ registry->Register(SetEGid);
+ registry->Register(SetEUid);
+ registry->Register(SetGid);
+ registry->Register(SetUid);
+ registry->Register(SetGroups);
+#endif // NODE_IMPLEMENTS_POSIX_CREDENTIALS
+}
+
static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
@@ -403,3 +423,5 @@ static void Initialize(Local<Object> target,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(credentials, node::credentials::Initialize)
+NODE_MODULE_EXTERNAL_REFERENCE(credentials,
+ node::credentials::RegisterExternalReferences)