mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
614 B
23 lines
614 B
'use strict';
|
|
// Requires special privileges
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
var oldgid = process.getgid();
|
|
process.setgid('nobody');
|
|
var newgid = process.getgid();
|
|
assert.notStrictEqual(newgid, oldgid, 'gids expected to be different');
|
|
|
|
var olduid = process.getuid();
|
|
process.setuid('nobody');
|
|
var newuid = process.getuid();
|
|
assert.notStrictEqual(newuid, olduid, 'uids expected to be different');
|
|
|
|
try {
|
|
process.setuid('nobody1234');
|
|
} catch (e) {
|
|
assert.strictEqual(e.message,
|
|
'failed to resolve group',
|
|
'unexpected error message'
|
|
);
|
|
}
|
|
|