Skip to content

Commit

Permalink
Use effective uid to set the userHome variable (#2150)
Browse files Browse the repository at this point in the history
* Use isRootUser function instead USER environment variable
 * Fix #2123
  • Loading branch information
amatas authored and bestander committed Dec 7, 2016
1 parent 6cca59f commit 24ce639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require('path');
let userHome = require('user-home');

if (process.platform === 'linux' && process.env.USER === 'root') {
if (process.platform === 'linux' && isRootUser(getUid())) {
userHome = path.resolve('/usr/local/share');
}

Expand Down

0 comments on commit 24ce639

Please sign in to comment.