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

Fixed JSON error in Process Enumeration that can occur in some linux distros

This commit is contained in:
Bryan Roe
2022-07-12 12:27:44 -07:00
parent 843a8bca54
commit f4880573f3
2 changed files with 6 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -132,8 +132,11 @@ function processManager() {
p.stdin.write(' gsub(/[ \\t]*[0-9]+[ \\t]*[^ ^\\t]+[ \\t]+/,"",$i);');
p.stdin.write(' gsub(/\\\\/,"\\\\\\\\",$i);');
p.stdin.write(' gsub(/"/,"\\\\\\"",$i);');
p.stdin.write(' printf "%s\\"%s\\":{\\"pid\\":\\"%s\\",\\"user\\":\\"%s\\",\\"cmd\\":\\"%s\\"}",(i==1?"":","),A[1],A[1],A[2],$i;');
// PID PID USER command
p.stdin.write(' if($i !~ /^awk /)');
p.stdin.write(' {');
p.stdin.write(' printf "%s\\"%s\\":{\\"pid\\":\\"%s\\",\\"user\\":\\"%s\\",\\"cmd\\":\\"%s\\"}",(i==1?"":","),A[1],A[1],A[2],$i;');
// PID PID USER command
p.stdin.write(' }');
p.stdin.write(' }');
p.stdin.write(' printf "}";');
p.stdin.write("}'\nexit\n");