1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-24 12:13:16 +00:00

Fixed edge case where user-sessions would report logged in user incorrectly is there was an ssh session logged in.

This commit is contained in:
Bryan Roe
2022-01-28 12:06:11 -08:00
parent 346ec43fb3
commit 3be3ce27e9
2 changed files with 3 additions and 2 deletions

View File

@@ -832,7 +832,7 @@ function UserSessions()
child.stdin.write(' split(lines[i], tok, " ");');
child.stdin.write(' if((tok[2]+0)>=' + min + ')');
child.stdin.write(' {');
child.stdin.write(' if(tok[4]=="") { continue; }');
child.stdin.write(' if(tok[4]=="" || tok[4]~/^pts\\//) { continue; }');
child.stdin.write(' printf "%s{\\"uid\\": \\"%s\\", \\"sid\\": \\"%s\\"}", del, tok[2], tok[1];');
child.stdin.write(' del=",";');
child.stdin.write(' }');
@@ -840,6 +840,7 @@ function UserSessions()
child.stdin.write('printf "]";');
child.stdin.write("}'\nexit\n");
child.waitExit();
console.log(child.stdout.str);
var info1 = JSON.parse(child.stdout.str);
var sids = [];
var i;