1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-02 00:23:17 +00:00

Fixed bug, where stderr was not subscribed, causing the stream to pause if stderr is written to, which will happen on Win Server when fetching AV state. If stream is paused, the waitExit() line will hang

This commit is contained in:
Bryan Roe
2019-08-05 11:12:00 -07:00
parent 4cef81719e
commit c0fcf75f58

View File

@@ -44,6 +44,7 @@ function av()
{
var child = require('child_process').execFile(process.env['windir'] + '\\System32\\wbem\\wmic.exe', ['wmic', '/Namespace:\\\\root\\SecurityCenter2', 'Path', 'AntiVirusProduct', 'get', '/FORMAT:CSV']);
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); })
child.waitExit();
var lines = child.stdout.str.trim().split('\r\n');