Skip to content
Open
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
10 changes: 5 additions & 5 deletions src/userid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ NAN_METHOD(GroupName)
struct group *group = NULL;

if ((info.Length() > 0) && info[0]->IsInt32()) {
group = getgrgid(info[0]->Int32Value());
group = getgrgid(info[0]->Int32Value(Nan::GetCurrentContext()).FromJust());
} else {
return Nan::ThrowError("you must supply the gid");
}
Expand Down Expand Up @@ -72,7 +72,7 @@ NAN_METHOD(Gids)
return Nan::ThrowError("you must supply the groupname");
}

String::Utf8Value utfname(info[0]->ToString());
v8::String::Utf8Value utfname(info.GetIsolate(), info[0]);
#ifdef __APPLE__
groups = new int[ngroups]; // malloc(ngroups * sizeof(gid_t));
#else // ifdef __APPLE__
Expand Down Expand Up @@ -115,7 +115,7 @@ NAN_METHOD(Gid)
struct group *group = NULL;

if ((info.Length() > 0) && info[0]->IsString()) {
String::Utf8Value utfname(info[0]->ToString());
v8::String::Utf8Value utfname(info.GetIsolate(), info[0]);
group = getgrnam(*utfname);
} else {
return Nan::ThrowError("you must supply the groupname");
Expand All @@ -134,7 +134,7 @@ NAN_METHOD(UserName)
struct passwd *user = NULL;

if ((info.Length() > 0) && info[0]->IsInt32()) {
user = getpwuid(info[0]->Int32Value());
user = getpwuid(info[0]->Int32Value(Nan::GetCurrentContext()).FromJust());
} else {
return Nan::ThrowError("you must supply the uid");
}
Expand All @@ -152,7 +152,7 @@ NAN_METHOD(Uid)
struct passwd *user = NULL;

if ((info.Length() > 0) && info[0]->IsString()) {
String::Utf8Value utfname(info[0]->ToString());
v8::String::Utf8Value utfname(info.GetIsolate(), info[0]);
user = getpwnam(*utfname);
} else {
return Nan::ThrowError("you must supply the username");
Expand Down