File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,8 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
211211 int fd;
212212 if (!args[0 ]->Int32Value (env->context ()).To (&fd)) return ;
213213
214+ THROW_IF_INSUFFICIENT_PERMISSIONS (env, permission::PermissionScope::kNet , " " );
215+
214216 int err = uv_pipe_open (&wrap->handle_ , fd);
215217 if (err == 0 ) wrap->set_fd (fd);
216218
Original file line number Diff line number Diff line change @@ -361,6 +361,10 @@ void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
361361 TCPWrap* wrap;
362362 ASSIGN_OR_RETURN_UNWRAP (
363363 &wrap, args.This (), args.GetReturnValue ().Set (UV_EBADF ));
364+ Environment* env = wrap->env ();
365+
366+ THROW_IF_INSUFFICIENT_PERMISSIONS (env, permission::PermissionScope::kNet , " " );
367+
364368 int64_t val;
365369 if (!args[0 ]->IntegerValue (args.GetIsolate ()->GetCurrentContext ()).To (&val))
366370 return ;
Original file line number Diff line number Diff line change @@ -368,6 +368,10 @@ void UDPWrap::Open(const FunctionCallbackInfo<Value>& args) {
368368 UDPWrap* wrap;
369369 ASSIGN_OR_RETURN_UNWRAP (
370370 &wrap, args.This (), args.GetReturnValue ().Set (UV_EBADF ));
371+ Environment* env = wrap->env ();
372+
373+ THROW_IF_INSUFFICIENT_PERMISSIONS (env, permission::PermissionScope::kNet , " " );
374+
371375 CHECK (args[0 ]->IsNumber ());
372376 int fd = FromV8Value<int >(args[0 ]);
373377 int err = uv_udp_open (&wrap->handle_ , fd);
You can’t perform that action at this time.
0 commit comments