diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index b708d0e0..32001b35 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 29af3c50..4c114c37 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 551c6d1f..0eb0aba7 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService.exe b/agents/MeshService.exe index d07b0c65..5e4feb7d 100644 Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index a3467ead..9c6530c8 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/MeshService64.exe b/agents/MeshService64.exe index 31b15918..94d695a1 100644 Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ diff --git a/agents/meshagent_arm b/agents/meshagent_arm index 76918b81..054af1fb 100644 Binary files a/agents/meshagent_arm and b/agents/meshagent_arm differ diff --git a/agents/meshagent_arm-linaro b/agents/meshagent_arm-linaro index c9b555cd..32b7a8bd 100644 Binary files a/agents/meshagent_arm-linaro and b/agents/meshagent_arm-linaro differ diff --git a/agents/meshagent_armhf b/agents/meshagent_armhf index f50b9795..34683720 100644 Binary files a/agents/meshagent_armhf and b/agents/meshagent_armhf differ diff --git a/agents/meshagent_pogo b/agents/meshagent_pogo index 382662d9..a1de6f61 100644 Binary files a/agents/meshagent_pogo and b/agents/meshagent_pogo differ diff --git a/agents/meshagent_poky b/agents/meshagent_poky index f29f310e..c5cfadd4 100644 Binary files a/agents/meshagent_poky and b/agents/meshagent_poky differ diff --git a/agents/meshagent_poky64 b/agents/meshagent_poky64 index 8910ca6e..9945bf99 100644 Binary files a/agents/meshagent_poky64 and b/agents/meshagent_poky64 differ diff --git a/agents/meshagent_x86 b/agents/meshagent_x86 index a1f5c198..72e83a16 100644 Binary files a/agents/meshagent_x86 and b/agents/meshagent_x86 differ diff --git a/agents/meshagent_x86-64 b/agents/meshagent_x86-64 index aedc667b..b608357b 100644 Binary files a/agents/meshagent_x86-64 and b/agents/meshagent_x86-64 differ diff --git a/agents/meshagent_x86-64_nokvm b/agents/meshagent_x86-64_nokvm index 9f9e9992..b98dc0af 100644 Binary files a/agents/meshagent_x86-64_nokvm and b/agents/meshagent_x86-64_nokvm differ diff --git a/agents/meshagent_x86_nokvm b/agents/meshagent_x86_nokvm index 9d36da11..e76597eb 100644 Binary files a/agents/meshagent_x86_nokvm and b/agents/meshagent_x86_nokvm differ diff --git a/agents/meshcore.js b/agents/meshcore.js index af294985..0deb5ee5 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -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() }); diff --git a/agents/modules_meshcmd/user-sessions.js b/agents/modules_meshcmd/user-sessions.js index a1a2a686..92bf78aa 100644 --- a/agents/modules_meshcmd/user-sessions.js +++ b/agents/modules_meshcmd/user-sessions.js @@ -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'); } } diff --git a/agents/modules_meshcore/user-sessions.js b/agents/modules_meshcore/user-sessions.js index d53db4d1..92bf78aa 100644 --- a/agents/modules_meshcore/user-sessions.js +++ b/agents/modules_meshcore/user-sessions.js @@ -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'); } } diff --git a/certoperations.js b/certoperations.js index 6b44ee93..8b0f17ce 100644 --- a/certoperations.js +++ b/certoperations.js @@ -148,6 +148,9 @@ module.exports.CertificateOperations = function () { // Make sure a string with Mac style CR endo of line is changed to Linux LF style. function fixEndOfLines(str) { + if (typeof (str) != 'string') return str; // If this is not a string, do nothing. + var i = str.indexOf('-----'); // Remove everything before "-----". + if (i > 0) { str = str.substring(i); } // this solves problems with editors that save text file type indicators ahead of the text. if ((typeof(str) != 'string') || (str.indexOf('\n') > 0)) return str; // If there is a \n in the file, keep the file as-is. return str.split('\r').join('\n'); // If there is no \n, replace all \r with \n. } diff --git a/package.json b/package.json index e3aa42f1..111f1586 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.2.6-e", + "version": "0.2.6-h", "keywords": [ "Remote Management", "Intel AMT", diff --git a/views/default.handlebars b/views/default.handlebars index 0496d81d..21a57d88 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -239,6 +239,7 @@

Account actions

+ Change email address
Change password
Delete account
@@ -1118,6 +1119,7 @@ updateSiteAdmin(); QV('verifyEmailId', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true)); QV('verifyEmailId2', (userinfo.emailVerified !== true) && (userinfo.email != null) && (serverinfo.emailcheck == true)); + //QV('addTwoFactorAuth', (userinfo.secauth != true) && ((features & 4096) != 0)); break; } case 'users': { @@ -5027,6 +5029,17 @@ // MY ACCOUNT // + function account_addTwoFactor() { + if (xxdialogMode || (userinfo.secauth == true) || ((features & 4096) == 0)) return; + var x = "Loading..."; + setDialogMode(2, "Add Two-Factor Authentication", 2, account_addTwoFactorEx, x); + meshserver.send({ action: 'secauth-request' }); + } + + function account_addTwoFactorEx() { + + } + function account_showVerifyEmail() { if (xxdialogMode || (userinfo.emailVerified == true) || (serverinfo.emailcheck != true)) return; var x = "Click ok to send a verification mail to:

" + EscapeHtml(userinfo.email) + "
Please wait a few minute to receive the verification."; diff --git a/webserver.js b/webserver.js index 4fda0d19..edd53fa1 100644 --- a/webserver.js +++ b/webserver.js @@ -780,6 +780,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if (obj.args.allowhighqualitydesktop == true) { features += 512; } // Enable AllowHighQualityDesktop (Default false) if (obj.args.lanonly == true || obj.args.mpsport == 0) { features += 1024; } // No CIRA if ((obj.parent.serverSelfWriteAllowed == true) && (user != null) && (user.siteadmin == 0xFFFFFFFF)) { features += 2048; } // Server can self-write (Allows self-update) + if (domain.auth != 'sspi') { features += 4096; } // Two-factor auth supported // Send the master web application if ((!obj.args.user) && (obj.args.nousers != true) && (nologout == false)) { logoutcontrol += ' Logout'; } // If a default user is in use or no user mode, don't display the logout button