Skip to content

Commit f345cf3

Browse files
committed
Stop using process.umask()
Ref nodejs/node#32321
1 parent fe502f4 commit f345cf3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mkdirp.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function mkdirp(dirpath, customMode, callback) {
1313
customMode = undefined;
1414
}
1515

16-
var mode = customMode || DEFAULT_DIR_MODE & ~process.umask();
16+
var mode = customMode || DEFAULT_DIR_MODE;
1717
dirpath = path.resolve(dirpath);
1818

1919
fs.mkdir(dirpath, mode, onMkdir);
@@ -46,12 +46,12 @@ function mkdirp(dirpath, customMode, callback) {
4646
return callback(mkdirErr);
4747
}
4848

49-
// TODO: Is it proper to mask like this?
50-
if ((stats.mode & MASK_MODE) === mode) {
49+
if (!customMode) {
5150
return callback();
5251
}
5352

54-
if (!customMode) {
53+
// TODO: Is it proper to mask like this?
54+
if ((stats.mode & MASK_MODE) === mode) {
5555
return callback();
5656
}
5757

@@ -64,7 +64,7 @@ function mkdirp(dirpath, customMode, callback) {
6464
return callback(recurseErr);
6565
}
6666

67-
mkdirp(dirpath, mode, callback);
67+
mkdirp(dirpath, customMode, callback);
6868
}
6969
}
7070

0 commit comments

Comments
 (0)