@depup/systeminformation 5.33.6-depup.0 → 5.33.8-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/systeminformation
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.6 |
17
- | Processed | 2026-08-30 |
16
+ | Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.8 |
17
+ | Processed | 2026-09-06 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-08-30T00:59:35.001Z",
3
+ "timestamp": "2026-09-06T01:00:18.743Z",
4
4
  "totalUpdated": 0
5
5
  }
package/lib/audio.js CHANGED
@@ -55,7 +55,7 @@ function parseAudioType(str, input, output) {
55
55
  if (str.indexOf('mikr') >= 0) {
56
56
  result = 'Microphone';
57
57
  }
58
- if (str.indexOf('phone') >= 0) {
58
+ if (str.indexOf('phone') >= 0 && str.indexOf('headphone') < 0) {
59
59
  result = 'Phone';
60
60
  }
61
61
  if (str.indexOf('controll') >= 0) {
@@ -111,11 +111,16 @@ function parseLinuxAudioAlsa(stdout) {
111
111
  const lines = cards.split('\n');
112
112
  lines.forEach((line, i) => {
113
113
  // ' 1 [Device ]: USB-Audio - USB Audio Device'
114
- const card = line.match(/^\s*(\d+)\s+\[(.+?)\s*\]:\s*(\S+)\s+-\s+(.*)$/);
115
- if (card) {
114
+ const card = line.match(/^\s*(\d+)\s+\[(.+?)\s*\]:\s*(.*)$/);
115
+ if (card && card[3].trim()) {
116
116
  const index = card[1];
117
- const driver = card[3];
118
- const name = card[4].trim();
117
+ // some drivers (e.g. bcm2835) print an unterminated driver string, gluing the name to it
118
+ const sep = card[3].lastIndexOf(' - ');
119
+ const name = (sep >= 0 ? card[3].substring(sep + 3) : card[3]).trim();
120
+ let driver = (sep >= 0 ? card[3].substring(0, sep) : '').trim();
121
+ if (name && driver.endsWith(name)) {
122
+ driver = driver.substring(0, driver.length - name.length).trim();
123
+ }
119
124
  // second line holds the long name, which is prefixed with the manufacturer on USB devices
120
125
  const longName = (lines[i + 1] || '').trim();
121
126
  const manufacturer = longName.indexOf(name) > 0 ? longName.substring(0, longName.indexOf(name)).trim() : '';
package/lib/filesystem.js CHANGED
@@ -1722,6 +1722,10 @@ function diskLayout(callback) {
1722
1722
  const smartDev = JSON.parse(execSync('smartctl --scan -j').toString());
1723
1723
  if (smartDev && smartDev.devices && smartDev.devices.length > 0) {
1724
1724
  smartDev.devices.forEach((dev) => {
1725
+ // device names come from smartctl output - never let anything but a plain path reach the shell
1726
+ if (!/^[\w/.,:\\-]+$/.test(String(dev.name || ''))) {
1727
+ return;
1728
+ }
1725
1729
  workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin));
1726
1730
  });
1727
1731
  }
package/lib/graphics.js CHANGED
@@ -17,6 +17,7 @@ const fs = require('fs');
17
17
  const path = require('path');
18
18
  const exec = require('child_process').exec;
19
19
  const execSync = require('child_process').execSync;
20
+ const execFileSync = require('child_process').execFileSync;
20
21
  const util = require('./util');
21
22
 
22
23
  const _platform = process.platform;
@@ -481,14 +482,9 @@ function graphics(callback) {
481
482
  if (nvidiaSmiExe) {
482
483
  const nvidiaSmiOpts =
483
484
  '--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits';
484
- const cmd = `"${nvidiaSmiExe}" ${nvidiaSmiOpts}`;
485
- if (_linux) {
486
- options.stdio = ['pipe', 'pipe', 'ignore'];
487
- }
485
+ options.stdio = ['pipe', 'pipe', 'ignore'];
488
486
  try {
489
- const sanitized = cmd + (_linux ? ' 2>/dev/null' : '') + (_windows ? ' 2> nul' : '');
490
- const res = execSync(sanitized, options).toString();
491
- return res;
487
+ return execFileSync(nvidiaSmiExe, nvidiaSmiOpts.split(' '), options).toString();
492
488
  } catch {
493
489
  util.noop();
494
490
  }
package/lib/internet.js CHANGED
@@ -166,6 +166,12 @@ function inetLatency(host, callback) {
166
166
  }
167
167
  return resolve(null);
168
168
  }
169
+ if (hostSanitized.startsWith('-')) {
170
+ if (callback) {
171
+ callback(null);
172
+ }
173
+ return resolve(null);
174
+ }
169
175
  let params;
170
176
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
171
177
  if (_linux) {
package/lib/network.js CHANGED
@@ -368,8 +368,8 @@ function getWindowsWiredProfilesInformation() {
368
368
 
369
369
  function getWindowsWirelessIfaceSSID(interfaceName) {
370
370
  try {
371
- const result = execSync(`netsh wlan show interface name="${interfaceName}" | findstr "SSID"`, util.execOptsWin);
372
- const SSID = result.split('\r\n').shift();
371
+ const result = execFileSync('netsh', ['wlan', 'show', 'interface', `name=${util.sanitizeString(interfaceName)}`], util.execOptsWin).toString();
372
+ const SSID = result.split('\r\n').find((l) => l.includes('SSID')) || '';
373
373
  const parseSSID = SSID.split(':').pop().trim();
374
374
  return parseSSID;
375
375
  } catch {
@@ -420,7 +420,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
420
420
  const SSID = getWindowsWirelessIfaceSSID(iface);
421
421
  if (SSID !== 'Unknown') {
422
422
  const ifaceSanitized = util.sanitizeString(SSID);
423
- const profiles = execSync(`netsh wlan show profiles "${ifaceSanitized}"`, util.execOptsWin).split('\r\n');
423
+ const profiles = execFileSync('netsh', ['wlan', 'show', 'profiles', ifaceSanitized], util.execOptsWin).toString().split('\r\n');
424
424
  i8021xState = (profiles.find((l) => l.indexOf('802.1X') >= 0) || '').trim();
425
425
  i8021xProtocol = (profiles.find((l) => l.indexOf('EAP') >= 0) || '').trim();
426
426
  }
@@ -943,7 +943,7 @@ function networkInterfaces(callback, rescan, defaultString) {
943
943
  ip6subnet = ip6linksubnet;
944
944
  }
945
945
  const iface = dev.split(':')[0].trim();
946
- const ifaceSanitized = util.sanitizeString(iface);
946
+ const ifaceSanitized = util.sanitizeString(iface, true);
947
947
  const cmd = `echo -n "addr_assign_type: "; cat /sys/class/net/${ifaceSanitized}/addr_assign_type 2>/dev/null; echo;
948
948
  echo -n "address: "; cat /sys/class/net/${ifaceSanitized}/address 2>/dev/null; echo;
949
949
  echo -n "addr_len: "; cat /sys/class/net/${ifaceSanitized}/addr_len 2>/dev/null; echo;
package/lib/osinfo.js CHANGED
@@ -18,7 +18,6 @@ const fs = require('fs');
18
18
  const util = require('./util');
19
19
  const exec = require('child_process').exec;
20
20
  const execSync = require('child_process').execSync;
21
- const execFile = require('child_process').execFile;
22
21
 
23
22
  const _platform = process.platform;
24
23
 
@@ -775,78 +774,47 @@ function versions(apps, callback) {
775
774
  });
776
775
  }
777
776
  if ({}.hasOwnProperty.call(appsObj.versions, 'postgresql')) {
778
- if (_linux) {
779
- exec('locate bin/postgres', (error, stdout) => {
780
- if (!error) {
781
- const safePath = /^[a-zA-Z0-9/_.-]+$/;
782
- const postgresqlBin = stdout
783
- .toString()
784
- .split('\n')
785
- .filter((p) => safePath.test(p.trim()))
786
- .sort();
787
- if (postgresqlBin.length) {
788
- execFile(postgresqlBin[postgresqlBin.length - 1], ['-V'], (error, stdout) => {
789
- if (!error) {
790
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
791
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
777
+ if (_windows) {
778
+ util.powerShell('Get-CimInstance Win32_Service | select caption | fl').then((stdout) => {
779
+ let serviceSections = stdout.split(/\n\s*\n/);
780
+ serviceSections.forEach((item) => {
781
+ if (item.trim() !== '') {
782
+ let lines = item.trim().split('\r\n');
783
+ let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();
784
+ if (srvCaption.indexOf('postgresql') > -1) {
785
+ const parts = srvCaption.split(' server ');
786
+ if (parts.length > 1) {
787
+ appsObj.versions.postgresql = parts[1];
792
788
  }
793
- functionProcessed();
794
- });
795
- } else {
796
- functionProcessed();
797
- }
798
- } else {
799
- exec('psql -V', (error, stdout) => {
800
- if (!error) {
801
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
802
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
803
- appsObj.versions.postgresql = appsObj.versions.postgresql.split('-')[0];
804
789
  }
805
- functionProcessed();
806
- });
807
- }
790
+ }
791
+ });
792
+ functionProcessed();
808
793
  });
809
794
  } else {
810
- if (_windows) {
811
- util.powerShell('Get-CimInstance Win32_Service | select caption | fl').then((stdout) => {
812
- let serviceSections = stdout.split(/\n\s*\n/);
813
- serviceSections.forEach((item) => {
814
- if (item.trim() !== '') {
815
- let lines = item.trim().split('\r\n');
816
- let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();
817
- if (srvCaption.indexOf('postgresql') > -1) {
818
- const parts = srvCaption.split(' server ');
819
- if (parts.length > 1) {
820
- appsObj.versions.postgresql = parts[1];
821
- }
822
- }
823
- }
824
- });
825
- functionProcessed();
826
- });
827
- } else {
828
- exec('postgres -V', (error, stdout) => {
829
- if (!error) {
830
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
831
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
832
- if (appsObj.versions.postgresql.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
833
- appsObj.versions.postgresql = postgresql[postgresql.length - 2];
834
- }
795
+ const parsePostgres = (stdout) => {
796
+ const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
797
+ let version = postgresql.length ? postgresql[postgresql.length - 1] : '';
798
+ if (version.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
799
+ version = postgresql[postgresql.length - 2];
800
+ }
801
+ return version.split('-')[0];
802
+ };
803
+ // no `locate`: its output is any user-writable path and must not be executed
804
+ const tryPostgres = (cmds) => {
805
+ if (!cmds.length) {
806
+ return functionProcessed();
807
+ }
808
+ exec(cmds[0], (error, stdout) => {
809
+ if (!error && stdout.toString().trim()) {
810
+ appsObj.versions.postgresql = parsePostgres(stdout);
835
811
  functionProcessed();
836
812
  } else {
837
- exec('pg_config --version', (error, stdout) => {
838
- if (!error) {
839
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
840
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
841
- if (appsObj.versions.postgresql.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
842
- appsObj.versions.postgresql = postgresql[postgresql.length - 2];
843
- }
844
- }
845
- functionProcessed();
846
- });
813
+ tryPostgres(cmds.slice(1));
847
814
  }
848
815
  });
849
- }
816
+ };
817
+ tryPostgres(['postgres -V', 'pg_config --version', 'psql -V']);
850
818
  }
851
819
  }
852
820
  if ({}.hasOwnProperty.call(appsObj.versions, 'perl')) {
package/lib/wifi.js CHANGED
@@ -193,7 +193,7 @@ function ifaceListLinux() {
193
193
  }
194
194
 
195
195
  function nmiDeviceLinux(iface) {
196
- const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2> /dev/null`;
196
+ const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${util.sanitizeString(iface, true)} 2> /dev/null`;
197
197
  try {
198
198
  const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
199
199
  const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/systeminformation",
3
- "version": "5.33.6-depup.0",
3
+ "version": "5.33.8-depup.0",
4
4
  "description": "Advanced, lightweight system and OS information library (with updated dependencies)",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
@@ -111,8 +111,8 @@
111
111
  "changes": {},
112
112
  "depsUpdated": 0,
113
113
  "originalPackage": "systeminformation",
114
- "originalVersion": "5.33.6",
115
- "processedAt": "2026-08-30T00:59:35.725Z",
114
+ "originalVersion": "5.33.8",
115
+ "processedAt": "2026-09-06T01:00:19.560Z",
116
116
  "smokeTest": "passed"
117
117
  }
118
118
  }