mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
f6cd4e3e59
Refs: https://github.com/nodejs/node/issues/25448 PR-URL: https://github.com/nodejs/node/pull/25526 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
33 lines
615 B
JavaScript
33 lines
615 B
JavaScript
'use strict';
|
|
|
|
// This tests that the lower bits of mode > 0o777 still works in
|
|
// process.umask()
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
if (!common.isMainThread)
|
|
common.skip('Setting process.umask is not supported in Workers');
|
|
|
|
let mask;
|
|
|
|
if (common.isWindows) {
|
|
mask = 0o600;
|
|
} else {
|
|
mask = 0o664;
|
|
}
|
|
|
|
const maskToIgnore = 0o10000;
|
|
|
|
const old = process.umask();
|
|
|
|
function test(input, output) {
|
|
process.umask(input);
|
|
assert.strictEqual(process.umask(), output);
|
|
|
|
process.umask(old);
|
|
}
|
|
|
|
test(mask | maskToIgnore, mask);
|
|
test((mask | maskToIgnore).toString(8), mask);
|