Skip to content

Commit

Permalink
fix: protect geteuid/getegid from being called on windows #3793
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Jul 17, 2018
1 parent 56f5e04 commit 0495bd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/API/Extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ module.exports = function(CLI) {
fmt.field('argv', process.argv);
fmt.field('argv0', process.argv0);
fmt.field('user', process.env.USER || process.env.LNAME || process.env.USERNAME);
if (process.geteuid)
if (cst.IS_WINDOWS === false && process.geteuid)
fmt.field('uid', process.geteuid());
if (process.getegid)
if (cst.IS_WINDOWS === false && process.getegid)
fmt.field('gid', process.getegid());

var os = require('os');
Expand Down
4 changes: 2 additions & 2 deletions lib/God/ActionMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ module.exports = function(God) {
argv0 : process.argv0,
argv : process.argv,
user : process.env.USER,
uid : process.geteuid ? process.geteuid() : 'N/A',
gid : process.getegid ? process.getegid() : 'N/A',
uid : (cst.IS_WINDOWS === false && process.geteuid) ? process.geteuid() : 'N/A',
gid : (cst.IS_WINDOWS === false && process.getegid) ? process.getegid() : 'N/A',
env : process.env,
managed_apps : Object.keys(God.clusters_db).length,
started_at : God.started_at
Expand Down

0 comments on commit 0495bd8

Please sign in to comment.