blob: bf3726ab006d36f17bfed0bda4f53cb6aaa39890 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
'use strict';
// Requires special privileges
var common = require('../common');
var assert = require('assert');
var oldgid = process.getgid();
process.setgid('nobody');
var newgid = process.getgid();
assert.notEqual(newgid, oldgid, 'gids expected to be different');
var olduid = process.getuid();
process.setuid('nobody');
var newuid = process.getuid();
assert.notEqual(newuid, olduid, 'uids expected to be different');
try {
process.setuid('nobody1234');
} catch (e) {
assert.equal(e.message,
'failed to resolve group',
'unexpected error message'
);
}
|