From 11d68eb3fc3c2f8d377cf8c50f1babb8d1f82d5f Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 3 Nov 2011 09:35:49 +0100 Subject: [PATCH] fs: make mkdir() default to 0777 permissions Fixes #1999. --- lib/fs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index ea668688fe..678e24aa35 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -354,11 +354,11 @@ fs.fsyncSync = function(fd) { }; fs.mkdir = function(path, mode, callback) { - binding.mkdir(path, modeNum(mode), callback || noop); + binding.mkdir(path, modeNum(mode, 511 /*=0777*/), callback || noop); }; fs.mkdirSync = function(path, mode) { - return binding.mkdir(path, modeNum(mode)); + return binding.mkdir(path, modeNum(mode, 511 /*=0777*/)); }; fs.sendfile = function(outFd, inFd, inOffset, length, callback) {