From f2382efb21d65c5c249e5cc64c83aa7bc5c4da94 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 26 Dec 2025 16:20:28 +0100 Subject: [PATCH] networkConnections: wip ss fix (linux) --- lib/network.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/network.js b/lib/network.js index 1cb1465..ea0cf50 100644 --- a/lib/network.js +++ b/lib/network.js @@ -1679,12 +1679,22 @@ function networkConnections(callback) { let pid = null; let process = ''; if (line.length >= 7 && line[6].indexOf('users:') > -1) { - const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); + const proc = line[6].replace('users:(("', '').replace(/"/g, '').replace('pid=', '').split(','); if (proc.length > 2) { - process = proc[0].split(' ')[0].split(':')[0]; - pid = parseInt(proc[1], 10); + process = proc[0]; + const pidValue = parseInt(proc[1], 10); + if (pidValue > 0) { + pid = pidValue; + } } } + // if (line.length >= 7 && line[6].indexOf('users:') > -1) { + // const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); + // if (proc.length > 2) { + // process = proc[0].split(' ')[0].split(':')[0]; + // pid = parseInt(proc[1], 10); + // } + // } if (connstate) { result.push({ protocol: line[0],