Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
int fd;
if (!args[0]->Int32Value(env->context()).To(&fd)) return;

THROW_IF_INSUFFICIENT_PERMISSIONS(env, permission::PermissionScope::kNet, "");

int err = uv_pipe_open(&wrap->handle_, fd);
if (err == 0) wrap->set_fd(fd);

Expand Down
4 changes: 4 additions & 0 deletions src/tcp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
TCPWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(
&wrap, args.This(), args.GetReturnValue().Set(UV_EBADF));
Environment* env = wrap->env();

THROW_IF_INSUFFICIENT_PERMISSIONS(env, permission::PermissionScope::kNet, "");

int64_t val;
if (!args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).To(&val))
return;
Expand Down
4 changes: 4 additions & 0 deletions src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ void UDPWrap::Open(const FunctionCallbackInfo<Value>& args) {
UDPWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(
&wrap, args.This(), args.GetReturnValue().Set(UV_EBADF));
Environment* env = wrap->env();

THROW_IF_INSUFFICIENT_PERMISSIONS(env, permission::PermissionScope::kNet, "");

CHECK(args[0]->IsNumber());
int fd = FromV8Value<int>(args[0]);
int err = uv_udp_open(&wrap->handle_, fd);
Expand Down
Loading