process.setegid()

process.setegid(id)

Note: this function is only available on POSIX platforms (i.e. not Windows, Android)

Sets the effective group identity of the process. (See setegid(2).) This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID.

if (process.getegid && process.setegid) {
  console.log(`Current gid: ${process.getegid()}`);
  try {
    process.setegid(501);
    console.log(`New gid: ${process.getegid()}`);
  }
  catch (err) {
    console.log(`Failed to set gid: ${err}`);
  }
}
doc_Nodejs
2016-04-30 04:41:21
Comments
Leave a Comment

Please login to continue.