Workaround / fix

#324 
Changing to the decimal representation allows this command to work properly:
node meshcentral --admin <your existing user name in format domain/username or username>

Does the default DB/ node / js not support hex literals?

This means that it is possible to for me to create an administrator user by alternate means to the first user policy. ( Which was not workin g for me )
This commit is contained in:
Kyle 2019-06-27 11:51:00 +10:00 committed by GitHub
parent fad86444ca
commit 4124ecf76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -614,7 +614,7 @@ function CreateMeshCentralServer(config, args) {
else { console.log('Invalid administrator name.'); process.exit(); return; } else { console.log('Invalid administrator name.'); process.exit(); return; }
obj.db.Get(adminname, function (err, user) { obj.db.Get(adminname, function (err, user) {
if (user.length != 1) { console.log('Invalid user name.'); process.exit(); return; } if (user.length != 1) { console.log('Invalid user name.'); process.exit(); return; }
user[0].siteadmin = 0xFFFFFFFF; user[0].siteadmin = 4294967295;
obj.db.Set(user[0], function () { obj.db.Set(user[0], function () {
if (user[0].domain == '') { console.log('User ' + user[0].name + ' set to site administrator.'); } else { console.log('User ' + user[0].name + ' of domain ' + user[0].domain + ' set to site administrator.'); } if (user[0].domain == '') { console.log('User ' + user[0].name + ' set to site administrator.'); } else { console.log('User ' + user[0].name + ' of domain ' + user[0].domain + ' set to site administrator.'); }
process.exit(); process.exit();