New agents, fixed cert loading with text prefix.

Ylian Saint-Hilaire committed Jan 15, 2019 at 09:20 UTC 2be76dd2209934a4cacaa923060cbc99e99b57ee
23 files changed +29 -10
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/MeshService-signed.exe
Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ
agents/MeshService.exe
Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ
agents/MeshService64-signed.exe
Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ
agents/MeshService64.exe
Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ
agents/meshagent_arm
Binary files a/agents/meshagent_arm and b/agents/meshagent_arm differ
agents/meshagent_arm-linaro
Binary files a/agents/meshagent_arm-linaro and b/agents/meshagent_arm-linaro differ
agents/meshagent_armhf
Binary files a/agents/meshagent_armhf and b/agents/meshagent_armhf differ
agents/meshagent_pogo
Binary files a/agents/meshagent_pogo and b/agents/meshagent_pogo differ
agents/meshagent_poky
Binary files a/agents/meshagent_poky and b/agents/meshagent_poky differ
agents/meshagent_poky64
Binary files a/agents/meshagent_poky64 and b/agents/meshagent_poky64 differ
agents/meshagent_x86
Binary files a/agents/meshagent_x86 and b/agents/meshagent_x86 differ
agents/meshagent_x86-64
Binary files a/agents/meshagent_x86-64 and b/agents/meshagent_x86-64 differ
agents/meshagent_x86-64_nokvm
Binary files a/agents/meshagent_x86-64_nokvm and b/agents/meshagent_x86-64_nokvm differ
agents/meshagent_x86_nokvm
Binary files a/agents/meshagent_x86_nokvm and b/agents/meshagent_x86_nokvm differ
agents/meshcore.js
+1 -1
@@ -1052,7 +1052,7 @@ function createMeshCore(agent) {
1052 child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ["/c", "start", url], { type: childProcess.SpawnTypes.USER });
1053 break;
1054 case 'linux':
1055 - child = require('child_process').execFile('/usr/bin/xdg-open', ['xdg-open', url], { type: require('child_process').SpawnTypes.DETACHED, uid: require('user-sessions').consoleUid() });
1055 + child = require('child_process').execFile('/usr/bin/xdg-open', ['xdg-open', url], { uid: require('user-sessions').consoleUid() });
1056 break;
1057 case 'darwin':
1058 child = require('child_process').execFile('/usr/bin/open', ['open', url], { uid: require('user-sessions').consoleUid() });
agents/modules_meshcmd/user-sessions.js
+5 -4
@@ -1,5 +1,5 @@
1 /*
2 -Copyright 2018-2019 Intel Corporation
2 +Copyright 2018 Intel Corporation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ function UserSessions()
93 }
94
95 this._user32 = this._marshal.CreateNativeProxy('user32.dll');
96 - this._user32.CreateMethod('RegisterPowerSettingNotification');
96 + this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1});
97 this._user32.CreateMethod('UnregisterPowerSettingNotification');
98 this._rpcrt = this._marshal.CreateNativeProxy('Rpcrt4.dll');
99 this._rpcrt.CreateMethod('UuidFromStringA');
@@ -653,7 +653,7 @@ function UserSessions()
653 }
654 this.consoleUid = function consoleUid()
655 {
656 - var checkstr = process.platform == 'darwin' ? 'console' : ':0';
656 + var checkstr = process.platform == 'darwin' ? 'console' : process.env['DISPLAY'];
657 var child = require('child_process').execFile('/bin/sh', ['sh']);
658 child.stdout.str = '';
659 child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
@@ -667,12 +667,13 @@ function UserSessions()
667 tokens = lines[i].split(' ');
668 for (j = 1; j < tokens.length; ++j)
669 {
670 - if (tokens[j].length > 0 && tokens[j] == checkstr)
670 + if (tokens[j].length > 0 && (tokens[j] == checkstr || tokens[j] == ('(' + checkstr + ')')))
671 {
672 return (parseInt(this._users()[tokens[0]]));
673 }
674 }
675 }
676 +
677 throw ('nobody logged into console');
678 }
679 }
agents/modules_meshcore/user-sessions.js
+5 -4
@@ -1,5 +1,5 @@
1 /*
2 -Copyright 2018-2019 Intel Corporation
2 +Copyright 2018 Intel Corporation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ function UserSessions()
93 }
94
95 this._user32 = this._marshal.CreateNativeProxy('user32.dll');
96 - this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1 });
96 + this._user32.CreateMethod({ method: 'RegisterPowerSettingNotification', threadDispatch: 1});
97 this._user32.CreateMethod('UnregisterPowerSettingNotification');
98 this._rpcrt = this._marshal.CreateNativeProxy('Rpcrt4.dll');
99 this._rpcrt.CreateMethod('UuidFromStringA');
@@ -653,7 +653,7 @@ function UserSessions()
653 }
654 this.consoleUid = function consoleUid()
655 {
656 - var checkstr = process.platform == 'darwin' ? 'console' : ':0';
656 + var checkstr = process.platform == 'darwin' ? 'console' : process.env['DISPLAY'];
657 var child = require('child_process').execFile('/bin/sh', ['sh']);
658 child.stdout.str = '';
659 child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
@@ -667,12 +667,13 @@ function UserSessions()
667 tokens = lines[i].split(' ');
668 for (j = 1; j < tokens.length; ++j)
669 {
670 - if (tokens[j].length > 0 && tokens[j] == checkstr)
670 + if (tokens[j].length > 0 && (tokens[j] == checkstr || tokens[j] == ('(' + checkstr + ')')))
671 {
672 return (parseInt(this._users()[tokens[0]]));
673 }
674 }
675 }
676 +
677 throw ('nobody logged into console');
678 }
679 }
certoperations.js
+3
@@ -148,6 +148,9 @@ module.exports.CertificateOperations = function () {
148
149 // Make sure a string with Mac style CR endo of line is changed to Linux LF style.
150 function fixEndOfLines(str) {
151 + if (typeof (str) != 'string') return str; // If this is not a string, do nothing.
152 + var i = str.indexOf('-----'); // Remove everything before "-----".
153 + if (i > 0) { str = str.substring(i); } // this solves problems with editors that save text file type indicators ahead of the text.
154 if ((typeof(str) != 'string') || (str.indexOf('\n') > 0)) return str; // If there is a \n in the file, keep the file as-is.
155 return str.split('\r').join('\n'); // If there is no \n, replace all \r with \n.
156 }
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.2.6-e",
3 + "version": "0.2.6-h",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
views/default.handlebars
+13
@@ -239,6 +239,7 @@
239 <p><strong><img alt="" width=150 height=103 src=images/mainaccount.jpg style=margin-bottom:10px;margin-right:20px;float:right />Account actions</strong></p>
240 <p style="margin-left:40px">
241 <span id="verifyEmailId" style="display:none"><a onclick="account_showVerifyEmail()" style="cursor:pointer">Verify email</a><br /></span>
242 + <span id="addTwoFactorAuth" style="display:none"><a onclick="account_addTwoFactor()" style="cursor:pointer">Add two-factor authentication</a><br /></span>
243 <a onclick="account_showChangeEmail()" style="cursor:pointer">Change email address</a><br />
244 <a onclick="account_showChangePassword()" style="cursor:pointer">Change password</a><br />
245 <a onclick="account_showDeleteAccount()" style="cursor:pointer">Delete account</a><br />
@@ -1118,6 +1119,7 @@
1119 updateSiteAdmin();
1120 QV('verifyEmailId', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true));
1121 QV('verifyEmailId2', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true));
1122 + //QV('addTwoFactorAuth', (userinfo.secauth != true) && ((features & 4096) != 0));
1123 break;
1124 }
1125 case 'users': {
@@ -5027,6 +5029,17 @@
5029 // MY ACCOUNT
5030 //
5031
5032 + function account_addTwoFactor() {
5033 + if (xxdialogMode || (userinfo.secauth == true) || ((features & 4096) == 0)) return;
5034 + var x = "Loading...";
5035 + setDialogMode(2, "Add Two-Factor Authentication", 2, account_addTwoFactorEx, x);
5036 + meshserver.send({ action: 'secauth-request' });
5037 + }
5038 +
5039 + function account_addTwoFactorEx() {
5040 +
5041 + }
5042 +
5043 function account_showVerifyEmail() {
5044 if (xxdialogMode || (userinfo.emailVerified == true) || (serverinfo.emailcheck != true)) return;
5045 var x = "Click ok to send a verification mail to:<br /><div style=padding:8px><b>" + EscapeHtml(userinfo.email) + "</b></div>Please wait a few minute to receive the verification.";
webserver.js
+1
@@ -780,6 +780,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
780 if (obj.args.allowhighqualitydesktop == true) { features += 512; } // Enable AllowHighQualityDesktop (Default false)
781 if (obj.args.lanonly == true || obj.args.mpsport == 0) { features += 1024; } // No CIRA
782 if ((obj.parent.serverSelfWriteAllowed == true) && (user != null) && (user.siteadmin == 0xFFFFFFFF)) { features += 2048; } // Server can self-write (Allows self-update)
783 + if (domain.auth != 'sspi') { features += 4096; } // Two-factor auth supported
784
785 // Send the master web application
786 if ((!obj.args.user) && (obj.args.nousers != true) && (nologout == false)) { logoutcontrol += ' <a href=' + domain.url + 'logout?' + Math.random() + ' style=color:white>Logout</a>'; } // If a default user is in use or no user mode, don't display the logout button