mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 19:11:51 +00:00
Input validation fix
This commit is contained in:
parent
069da0d9a8
commit
4c8a66c9d1
1 changed files with 2 additions and 1 deletions
|
@ -617,7 +617,8 @@ function CreateMeshCentralServer(config, args) {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (obj.args.adminaccount || (obj.args.resetaccount.startsWith('user/') == false)) {
|
if (obj.args.adminaccount) {
|
||||||
|
if (obj.args.resetaccount.startsWith('user/') == false) { console.log('Invalid userid, usage: --adminaccount [userid].'); process.exit(); return; }
|
||||||
obj.db.Get(obj.args.adminaccount, function (err, docs) {
|
obj.db.Get(obj.args.adminaccount, function (err, docs) {
|
||||||
if ((err != null) || (docs == null) || (docs.length == 0)) { console.log('Unknown userid, usage: --adminaccount [userid].'); process.exit(); return; }
|
if ((err != null) || (docs == null) || (docs.length == 0)) { console.log('Unknown userid, usage: --adminaccount [userid].'); process.exit(); return; }
|
||||||
docs[0].siteadmin = 0xFFFFFFFF; // Set user as site administrator
|
docs[0].siteadmin = 0xFFFFFFFF; // Set user as site administrator
|
||||||
|
|
Loading…
Reference in a new issue