mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-22 19:12:28 -05:00
prevent runcommand with --reply from terminating other ws connections (#6797)
This commit is contained in:
parent
4b621a01fb
commit
0ab3f01ca6
@ -1579,7 +1579,7 @@ function handleServerCommand(data) {
|
|||||||
mesh.cmdchild = require('child_process').execFile('/bin/sh', ['sh'], options);
|
mesh.cmdchild = require('child_process').execFile('/bin/sh', ['sh'], options);
|
||||||
mesh.cmdchild.descriptorMetadata = 'UserCommandsShell';
|
mesh.cmdchild.descriptorMetadata = 'UserCommandsShell';
|
||||||
mesh.cmdchild.stdout.on('data', function (c) { replydata += c.toString(); });
|
mesh.cmdchild.stdout.on('data', function (c) { replydata += c.toString(); });
|
||||||
mesh.cmdchild.stderr.on('data', function (c) { replydata + c.toString(); });
|
mesh.cmdchild.stderr.on('data', function (c) { replydata += c.toString(); });
|
||||||
mesh.cmdchild.stdin.write(data.cmds.split('\r').join('') + '\nexit\n');
|
mesh.cmdchild.stdin.write(data.cmds.split('\r').join('') + '\nexit\n');
|
||||||
mesh.cmdchild.on('exit', function () {
|
mesh.cmdchild.on('exit', function () {
|
||||||
if (data.reply) {
|
if (data.reply) {
|
||||||
|
@ -2243,6 +2243,7 @@ function serverConnect() {
|
|||||||
case 'removeDeviceShare':
|
case 'removeDeviceShare':
|
||||||
case 'userbroadcast': { // BROADCAST
|
case 'userbroadcast': { // BROADCAST
|
||||||
if ((settings.cmd == 'shell') || (settings.cmd == 'upload') || (settings.cmd == 'download')) return;
|
if ((settings.cmd == 'shell') || (settings.cmd == 'upload') || (settings.cmd == 'download')) return;
|
||||||
|
if ((data.type == 'runcommands') && (settings.cmd != 'runcommand')) return;
|
||||||
if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; }
|
if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; }
|
||||||
if (data.responseid == 'meshctrl') {
|
if (data.responseid == 'meshctrl') {
|
||||||
if (data.meshid) { console.log(data.result, data.meshid); }
|
if (data.meshid) { console.log(data.result, data.meshid); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user