mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
if using sockets, reset the umask back to the old value after listening
This commit is contained in:
@@ -101,11 +101,12 @@ if(nconf.get('ssl')) {
|
|||||||
|
|
||||||
var isSocket = isNaN(port),
|
var isSocket = isNaN(port),
|
||||||
args = isSocket ? [port] : [port, nconf.get('bind_address')],
|
args = isSocket ? [port] : [port, nconf.get('bind_address')],
|
||||||
bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')) + ':' + port;
|
bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')) + ':' + port,
|
||||||
|
oldUmask;
|
||||||
|
|
||||||
// Alter umask if necessary
|
// Alter umask if necessary
|
||||||
if (isSocket) {
|
if (isSocket) {
|
||||||
process.umask('0000');
|
oldUmask = process.umask('0000');
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push(function(err) {
|
args.push(function(err) {
|
||||||
@@ -115,6 +116,10 @@ if(nconf.get('ssl')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
winston.info('NodeBB is now listening on: ' + (isSocket ? port : bind_address));
|
winston.info('NodeBB is now listening on: ' + (isSocket ? port : bind_address));
|
||||||
|
if (oldUmask) {
|
||||||
|
process.umask(oldUmask);
|
||||||
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user