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 )
Kyle committed
Jun 27, 2019 at 11:51 UTC
00283b4a1a219e28338e17c2135182cafdfc94b3
1 file changed
+1
-1
meshcentral.js
+1
-1
@@ -614,7 +614,7 @@ function CreateMeshCentralServer(config, args) {
614
else { console.log('Invalid administrator name.'); process.exit(); return; }
615
obj.db.Get(adminname, function (err, user) {
616
if (user.length != 1) { console.log('Invalid user name.'); process.exit(); return; }
617
- user[0].siteadmin = 0xFFFFFFFF;
617
+ user[0].siteadmin = 4294967295;
618
obj.db.Set(user[0], function () {
619
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.'); }
620
process.exit();