(interactor) add randomized bytes to default hostname when linking #2906

This commit is contained in:
vmarchaud 2017-05-25 23:43:29 +02:00
parent 4d07d66c10
commit ebddff2db0

View File

@ -18,6 +18,7 @@ var cst = require('../../constants.js');
var Common = require('../Common');
var json5 = require('../tools/json5.js');
var UX = require('../API/CliUx.js');
var crypto = require('crypto');
var InteractorDaemonizer = module.exports = {};
@ -375,7 +376,7 @@ InteractorDaemonizer.getOrSetConf = function(conf, infos, cb) {
return cb(new Error('public key is not defined'));
if (!machine_name)
machine_name = os.hostname();
machine_name = os.hostname() + '-' + crypto.randomBytes(4).toString('hex');
/**
* Write new data to configuration file