...
 
Commits (1)
  • Rob Swindell's avatar
    Anonymous nodes are now shown as "Anonymous" to non-sysops. · b60c8cfc
    Rob Swindell authored
    Users that have put their terminal node into anonymous state (e.g.
    by using the ;anon command) should not have their identity exposed
    to non-sysops. This flaw was reported by altere in #synchronet.
    
    I'm not supporting translation of "Anonymous" here. We're not doing
    that for anonymously-posted messages either (yet), so I figured that
    was okay for now. There is a text.dat string for the word "Anonymous",
    it'd be nice if we just reused that, maybe.
    
    I also changed the node.status value magic number (3) to NODE_INUSE
    since we're loading nodedefs.js anyway, might as well.
    
    I'm not sure if it matters, but root/api/system.ssjs does not have
    this anonymous check either. I'm not sure where that code is used.
    b60c8cfc
......@@ -8,6 +8,7 @@ const node_state = system.node_list.map(function (e, i) {
aux: -1,
extaux: -1,
useron: -1,
misc: -1,
connection : -1
};
});
......@@ -19,6 +20,7 @@ function scan_nodes() {
system.node_list.forEach(function (e, i) {
const n = system.node_list[i];
if (n.status != node_state[i].status
|| n.misc != node_state[i].misc
|| n.action != node_state[i].action
|| n.useron != node_state[i].useron
) {
......@@ -27,6 +29,7 @@ function scan_nodes() {
status: n.status,
action: n.action,
aux: n.aux,
misc: n.misc,
extaux: n.extaux,
useron: n.useron,
connection: n.connection
......@@ -67,7 +70,7 @@ function scan() {
const web_change = scan_web();
if (node_change) {
out = node_state.map(function (e, i) {
if (e.status != 3) {
if (e.status != NODE_INUSE) {
return {
node: i + 1,
status: null,
......@@ -81,7 +84,7 @@ function scan() {
node: i + 1,
status: format(NodeStatus[e.status], e.aux, e.extaux),
action: format(NodeAction[e.action], e.aux, e.extaux),
user: usr.alias,
user: (e.misc & NODE_ANON) && !user.is_sysop ? "Anonymous" : usr.alias,
connection : NodeConnectionProper[e.connection] ? NodeConnectionProper[e.connection] : (e.connection + ' bps')
};
}
......