1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added network interface names escaping.

This commit is contained in:
Ylian Saint-Hilaire 2020-12-28 23:14:15 -08:00
parent cce68922d7
commit 8fc23995b9
3 changed files with 26 additions and 3 deletions

View file

@ -3857,6 +3857,15 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
db.Get('if' + node._id, function (err, netinfos) {
if ((netinfos == null) || (netinfos.length != 1)) { try { ws.send(JSON.stringify({ action: 'getnetworkinfo', nodeid: node._id, netif: null, netif2: null })); } catch (ex) { } return; }
var netinfo = netinfos[0];
// Unescape any field names that have special characters if needed
if (netinfo.netif2 != null) {
for (var i in netinfo.netif2) {
var esc = common.unEscapeFieldName(i);
if (esc !== i) { netinfo.netif2[esc] = netinfo.netif2[i]; delete netinfo.netif2[i]; }
}
}
try { ws.send(JSON.stringify({ action: 'getnetworkinfo', nodeid: node._id, updateTime: netinfo.updateTime, netif: netinfo.netif, netif2: netinfo.netif2 })); } catch (ex) { }
});
});