diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 8159ae21..089899d8 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index cd1d2266..ed23dd54 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe index e0d3e23c..8eabf604 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index e8e8b086..e0a7eedd 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/modules_meshcore/monitor-info.js b/agents/modules_meshcore/monitor-info.js index c809d923..b89509a8 100644 --- a/agents/modules_meshcore/monitor-info.js +++ b/agents/modules_meshcore/monitor-info.js @@ -8,6 +8,33 @@ var _NET_WM_STATE_TOGGLE = 2; // toggle property var SubstructureRedirectMask = (1 << 20); var SubstructureNotifyMask = (1 << 19); +function getLibInfo(libname) +{ + if (process.platform != 'linux') { throw ('Only supported on linux'); } + + var child = require('child_process').execFile('/bin/sh', ['sh']); + child.stdout.str = ''; + child.stdout.on('data', function (chunk) { this.str += chunk.toString(); }); + child.stdin.write("ldconfig -p | grep '" + libname + ".so.'\nexit\n"); + child.waitExit(); + + var v = []; + var lines = child.stdout.str.split('\n'); + for (var i in lines) { + if (lines[i]) { + var info = lines[i].split('=>'); + var pth = info[1].trim(); + var libinfo = info[0].trim().split(' '); + var lib = libinfo[0]; + var plat = libinfo[1].substring(1, libinfo[1].length - 1).split(','); + + if (lib.startsWith(libname + '.so.')) { + v.push({ lib: lib, path: pth, info: plat }); + } + } + } + return (v); +} function monitorinfo() { @@ -44,46 +71,67 @@ function monitorinfo() if (info._user32.EnumDisplayMonitors(0, 0, this._monitorinfo.callback, this._monitorinfo.dwData).Val == 0) { rejector('LastError=' + info._kernel32.GetLastError().Val); return; - } else { + } + else { resolver(this._monitorinfo.callback.results); } })); } } - else if (process.platform == 'linux') + else if(process.platform == 'linux') { // First thing we need to do, is determine where the X11 libraries are var askOS = false; - try { if (require('user-sessions').isRoot()) { askOS = true; } } catch (e) { } + try + { + if (require('user-sessions').isRoot()) { askOS = true; } + } + catch (e) + { } if (askOS) { // Sufficient access rights to use ldconfig - var p = require('child_process').execFile('/bin/sh', ['sh']); - p.stdout._lines = ''; - p.stdout.on('data', function (chunk) { this._lines += chunk.toString(); }); - p.stdin.write('ldconfig -v\nexit\n'); - p.waitExit(); + var x11info = getLibInfo('libX11'); + var xtstinfo = getLibInfo('libXtst'); + var xextinfo = getLibInfo('libXext'); + var ix; - var paths = p.stdout._lines.split('\n'); - var searchPath = ''; - for (var i in paths) { - if (paths[i].endsWith(':')) { - searchPath = paths[i].substring(0, paths[i].length - 1); - } else { - try { // Added by Ylian: Try/catch to fix X11 detection, not sure if this is correct. - if (paths[i].split('libX11.').length > 1) - { - //require('MeshAgent').SendCommand({ "action": "msg", "type": "console", "value": "path = " + searchPath + '/' + paths[i].split('->')[1].trim() }); - Object.defineProperty(this, 'Location_X11LIB', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); - } - if (paths[i].split('libXtst.').length > 1) { Object.defineProperty(this, 'Location_X11TST', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); } - if (paths[i].split('libXext.').length > 1) { Object.defineProperty(this, 'Location_X11EXT', { value: searchPath + '/' + paths[i].split('->')[1].trim() }); } - } catch (ex) - { - //require('MeshAgent').SendCommand({ "action": "msg", "type": "console", "value": "[" + searchPath + '/' + paths[i].split('->')[1].trim() + "] uncaughtException7: " + ex }); - } + for(ix in x11info) + { + try + { + this._gm.CreateNativeProxy(x11info[ix].path); + Object.defineProperty(this, 'Location_X11LIB', { value: x11info[ix].path }); + break; + } + catch(ex) + { + } + } + for (ix in xtstinfo) + { + try + { + this._gm.CreateNativeProxy(xtstinfo[ix].path); + Object.defineProperty(this, 'Location_X11TST', { value: xtstinfo[ix].path }); + break; + } + catch (ex) + { + } + } + for (ix in xextinfo) + { + try + { + this._gm.CreateNativeProxy(xextinfo[ix].path); + Object.defineProperty(this, 'Location_X11EXT', { value: xextinfo[ix].path }); + break; + } + catch (ex) + { } } } diff --git a/package.json b/package.json index d2228b0a..2b99bd2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.2.3-l", + "version": "0.2.3-o", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default-min.handlebars b/views/default-min.handlebars index 1e6958b2..13e428ad 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -1 +1 @@ -
{{{logoutControl}}}
My Devices | My Account | My Events | My Files |
{{{logoutControl}}}
My Devices | My Account | My Events | My Files |