Skip to content
Snippets Groups Projects
Commit 16c5298f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Log the current connection protocol as a separate property in logon.jsonl

Accession reported that (sometimes?) his NNTP logins show up in his
logon.jsonl files. This is most likely just a race condition when logging
in close to the same time with multiple protocols (e.g. Telnet and NNTP
in this case). So, let's log the client.protocol as a separate JSON property
and not require on the user.connection property (which is overwritten for
*every* login, for almost all connection/server types, not just the terminal
server). The client.protocol is always correct for the current session running
the script.

An NNTP login should never appear in the logon.json file.
parent 3a029fa8
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -17,6 +17,8 @@ function add(obj)
obj = {};
if(obj.time === undefined)
obj.time = time();
if(obj.protocol === undefined)
obj.protocol = client.protocol;
if(obj.user === undefined) {
obj.user = JSON.parse(JSON.stringify(user));
obj.user.limits = undefined;
......
......@@ -83,7 +83,7 @@ function print(hdr, num, days_ago)
,(system.settings & SYS_LISTLOC) ? record.user.location : record.user.note
,date.getHours()
,date.getMinutes()
,record.user.connection
,record.protocol || record.user.connection
,record.user.stats.logons_today
));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment