From 834544b2b2da07c08bdb61fbfcab3e35c6f7ca7c Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 18 Jul 2021 18:02:30 -0700 Subject: [PATCH] Fixed Intel AMT event log parsing exception. --- agents/modules_meshcmd/amt.js | 2 +- redirserver.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/agents/modules_meshcmd/amt.js b/agents/modules_meshcmd/amt.js index e99e54a6..2b06389b 100644 --- a/agents/modules_meshcmd/amt.js +++ b/agents/modules_meshcmd/amt.js @@ -488,7 +488,7 @@ function AmtStackCreateService(wsmanStack) { function _GetMessageLog1(stack, name, responses, status, tag) { if (status != 200 || responses.Body["ReturnValue"] != '0') { tag[0](obj, null, tag[2], status); return; } var i, j, x, e, AmtMessages = tag[2], t = new Date(), TimeStamp, ra = responses.Body["RecordArray"]; - if (typeof ra === 'string') { responses.Body["RecordArray"] = [responses.Body["RecordArray"]]; } + if (typeof ra === 'string') { ra = [ra]; } for (i in ra) { e = Buffer.from(ra[i], 'base64'); diff --git a/redirserver.js b/redirserver.js index 3d1abebb..1d82f051 100644 --- a/redirserver.js +++ b/redirserver.js @@ -113,14 +113,13 @@ module.exports.CreateRedirServer = function (parent, db, args, func) { if (parent.config.domains[i].dns != null) { continue; } var url = parent.config.domains[i].url; obj.app.get(url, performRedirection); // Root redirection - obj.app.get(url + 'player.htm', performRedirection); // Player redirection // Setup any .well-known folders var p = obj.parent.path.join(obj.parent.datapath, '.well-known' + ((parent.config.domains[i].id == '') ? '' : ('-' + parent.config.domains[i].id))); if (obj.parent.fs.existsSync(p)) { obj.app.use(url + '.well-known', obj.express.static(p)); } // Setup all of the redirections to HTTPS - const redirections = ['terms', 'logout', 'MeshServerRootCert.cer', 'mescript.ashx', 'checkmail', 'agentinvite', 'messenger', 'meshosxagent', 'devicepowerevents.ashx', 'downloadfile.ashx', 'userfiles/*', 'webrelay.ashx', 'health.ashx', 'logo.png', 'welcome.jpg']; + const redirections = ['player.htm', 'terms', 'logout', 'MeshServerRootCert.cer', 'mescript.ashx', 'checkmail', 'agentinvite', 'messenger', 'meshosxagent', 'devicepowerevents.ashx', 'downloadfile.ashx', 'userfiles/*', 'webrelay.ashx', 'health.ashx', 'logo.png', 'welcome.jpg']; for (i in redirections) { obj.app.get(url + redirections[i], performRedirection); } }