mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-24 13:13:13 -05:00
Fix for #2731
This commit is contained in:
parent
7d4c03fdc1
commit
75bb1f3e52
18
meshuser.js
18
meshuser.js
@ -155,12 +155,13 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
if (parent.parent.multiServer != null) { parent.parent.multiServer.DispatchMessage({ action: 'sessionEnd', sessionid: ws.sessionId }); }
|
if (parent.parent.multiServer != null) { parent.parent.multiServer.DispatchMessage({ action: 'sessionEnd', sessionid: ws.sessionId }); }
|
||||||
|
|
||||||
// Aggressive cleanup
|
// Aggressive cleanup
|
||||||
if (obj.user) { delete obj.user; }
|
delete obj.user;
|
||||||
if (obj.domain) { delete obj.domain; }
|
delete obj.domain;
|
||||||
if (ws.userid) { delete ws.userid; }
|
delete ws.userid;
|
||||||
if (ws.domainid) { delete ws.domainid; }
|
delete ws.domainid;
|
||||||
if (ws.sessionId) { delete ws.sessionId; }
|
delete ws.clientIp;
|
||||||
if (ws.HandleEvent) { delete ws.HandleEvent; }
|
delete ws.sessionId;
|
||||||
|
delete ws.HandleEvent;
|
||||||
ws.removeAllListeners(['message', 'close', 'error']);
|
ws.removeAllListeners(['message', 'close', 'error']);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -329,6 +330,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
// Associate this websocket session with the web session
|
// Associate this websocket session with the web session
|
||||||
ws.userid = user._id;
|
ws.userid = user._id;
|
||||||
ws.domainid = domain.id;
|
ws.domainid = domain.id;
|
||||||
|
ws.clientIp = req.clientIp;
|
||||||
|
|
||||||
// Create a new session id for this user.
|
// Create a new session id for this user.
|
||||||
parent.crypto.randomBytes(20, function (err, randombuf) {
|
parent.crypto.randomBytes(20, function (err, randombuf) {
|
||||||
@ -1299,9 +1301,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
userSessionCount++;
|
userSessionCount++;
|
||||||
r += (i + ', ' + parent.wssessions[i].length + ' session' + ((parent.wssessions[i].length > 1) ? 's' : '') + '.\r\n');
|
r += (i + ', ' + parent.wssessions[i].length + ' session' + ((parent.wssessions[i].length > 1) ? 's' : '') + '.\r\n');
|
||||||
for (var j in parent.wssessions[i]) {
|
for (var j in parent.wssessions[i]) {
|
||||||
var addr = parent.wssessions[i][j]._socket.remoteAddress;
|
r += ' ' + parent.wssessions[i][j].clientIp + ' --> ' + parent.wssessions[i][j].sessionId + '\r\n';
|
||||||
if (addr.startsWith('::ffff:')) { addr = addr.substring(7); }
|
|
||||||
r += ' ' + addr + ' --> ' + parent.wssessions[i][j].sessionId + '\r\n';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12388,7 +12388,9 @@
|
|||||||
114: "Removed push notification authentication device",
|
114: "Removed push notification authentication device",
|
||||||
115: "Added login token",
|
115: "Added login token",
|
||||||
116: "Removed login token",
|
116: "Removed login token",
|
||||||
117: "This is an old agent version, consider updating."
|
117: "This is an old agent version, consider updating.",
|
||||||
|
118: "This agent has an outstated certificate validation mechanism, consider updating.",
|
||||||
|
119: "This agent is using insecure tunnels, consider updating."
|
||||||
};
|
};
|
||||||
|
|
||||||
// Highlights the device being hovered
|
// Highlights the device being hovered
|
||||||
|
Loading…
x
Reference in New Issue
Block a user