mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
New agents, fixed cert loading with text prefix.
This commit is contained in:
parent
b514efaaf1
commit
e7c3c2cd70
23 changed files with 29 additions and 10 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1052,7 +1052,7 @@ function createMeshCore(agent) {
|
|||
child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ["/c", "start", url], { type: childProcess.SpawnTypes.USER });
|
||||
break;
|
||||
case 'linux':
|
||||
child = require('child_process').execFile('/usr/bin/xdg-open', ['xdg-open', url], { type: require('child_process').SpawnTypes.DETACHED, uid: require('user-sessions').consoleUid() });
|
||||
child = require('child_process').execFile('/usr/bin/xdg-open', ['xdg-open', url], { uid: require('user-sessions').consoleUid() });
|
||||
break;
|
||||
case 'darwin':
|
||||
child = require('child_process').execFile('/usr/bin/open', ['open', url], { uid: require('user-sessions').consoleUid() });
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2018-2019 Intel Corporation
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -93,7 +93,7 @@ function UserSessions()
|
|||
}
|
||||
|
||||
this._user32 = this._marshal.CreateNativeProxy('user32.dll');
|
||||
this._user32.CreateMethod('RegisterPowerSettingNotification');
|
||||
this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1});
|
||||
this._user32.CreateMethod('UnregisterPowerSettingNotification');
|
||||
this._rpcrt = this._marshal.CreateNativeProxy('Rpcrt4.dll');
|
||||
this._rpcrt.CreateMethod('UuidFromStringA');
|
||||
|
@ -653,7 +653,7 @@ function UserSessions()
|
|||
}
|
||||
this.consoleUid = function consoleUid()
|
||||
{
|
||||
var checkstr = process.platform == 'darwin' ? 'console' : ':0';
|
||||
var checkstr = process.platform == 'darwin' ? 'console' : process.env['DISPLAY'];
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
child.stdout.str = '';
|
||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
|
@ -667,12 +667,13 @@ function UserSessions()
|
|||
tokens = lines[i].split(' ');
|
||||
for (j = 1; j < tokens.length; ++j)
|
||||
{
|
||||
if (tokens[j].length > 0 && tokens[j] == checkstr)
|
||||
if (tokens[j].length > 0 && (tokens[j] == checkstr || tokens[j] == ('(' + checkstr + ')')))
|
||||
{
|
||||
return (parseInt(this._users()[tokens[0]]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw ('nobody logged into console');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2018-2019 Intel Corporation
|
||||
Copyright 2018 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -93,7 +93,7 @@ function UserSessions()
|
|||
}
|
||||
|
||||
this._user32 = this._marshal.CreateNativeProxy('user32.dll');
|
||||
this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1 });
|
||||
this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1});
|
||||
this._user32.CreateMethod('UnregisterPowerSettingNotification');
|
||||
this._rpcrt = this._marshal.CreateNativeProxy('Rpcrt4.dll');
|
||||
this._rpcrt.CreateMethod('UuidFromStringA');
|
||||
|
@ -653,7 +653,7 @@ function UserSessions()
|
|||
}
|
||||
this.consoleUid = function consoleUid()
|
||||
{
|
||||
var checkstr = process.platform == 'darwin' ? 'console' : ':0';
|
||||
var checkstr = process.platform == 'darwin' ? 'console' : process.env['DISPLAY'];
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
child.stdout.str = '';
|
||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
|
@ -667,12 +667,13 @@ function UserSessions()
|
|||
tokens = lines[i].split(' ');
|
||||
for (j = 1; j < tokens.length; ++j)
|
||||
{
|
||||
if (tokens[j].length > 0 && tokens[j] == checkstr)
|
||||
if (tokens[j].length > 0 && (tokens[j] == checkstr || tokens[j] == ('(' + checkstr + ')')))
|
||||
{
|
||||
return (parseInt(this._users()[tokens[0]]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw ('nobody logged into console');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue