systeminformation 5.31.14 → 5.31.16

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/lib/cpu.js CHANGED
@@ -1430,7 +1430,7 @@ function cpuTemperature(callback) {
1430
1430
  else if (s.startsWith('coretemp') || s.startsWith('core')) section = 'core';
1431
1431
  else if (s.startsWith('k10temp')) section = 'coreAMD';
1432
1432
  else if (s.startsWith('cpu_thermal') || s.startsWith('cpu-thermal') || s.startsWith('soc_thermal') || s.startsWith('cpu')) section = 'cpuThermal';
1433
- else section = 'other';
1433
+ else section = 'other';
1434
1434
  newSectionStarts = false;
1435
1435
  }
1436
1436
 
@@ -2016,6 +2016,9 @@ function getLoad() {
2016
2016
  const cpus = os.cpus().map((cpu) => {
2017
2017
  cpu.times.steal = 0;
2018
2018
  cpu.times.guest = 0;
2019
+ if (_windows) {
2020
+ cpu.times.sys = Math.max(0, cpu.times.sys - cpu.times.irq);
2021
+ }
2019
2022
  return cpu;
2020
2023
  });
2021
2024
  let totalUser = 0;
@@ -2230,7 +2233,7 @@ function getFullLoad() {
2230
2233
  for (let i = 0, len = cpus.length; i < len; i++) {
2231
2234
  const cpu = cpus[i].times;
2232
2235
  totalUser += cpu.user;
2233
- totalSystem += cpu.sys;
2236
+ totalSystem += _windows ? Math.max(0, cpu.sys - cpu.irq) : cpu.sys;
2234
2237
  totalNice += cpu.nice;
2235
2238
  totalIrq += cpu.irq;
2236
2239
  totalIdle += cpu.idle;
package/lib/filesystem.js CHANGED
@@ -214,7 +214,7 @@ function fsSize(drive, callback) {
214
214
  }
215
215
  if (_windows) {
216
216
  try {
217
- const driveSanitized = drive ? util.sanitizeShellString(drive, true) : '';
217
+ const driveSanitized = drive ? util.sanitizeString(drive, true) : '';
218
218
  const cmd = `Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${driveSanitized ? '| where -property Caption -eq ' + driveSanitized : ''} | fl`;
219
219
  util.powerShell(cmd).then((stdout, error) => {
220
220
  if (!error) {
@@ -484,7 +484,7 @@ function raidMatchLinux(data) {
484
484
  try {
485
485
  data.forEach((element) => {
486
486
  if (element.type.startsWith('raid')) {
487
- const lines = execSync(`mdadm --export --detail /dev/${element.name}`, util.execOptsLinux).toString().split('\n');
487
+ const lines = execSync(`mdadm --export --detail /dev/${util.sanitizeString(element.name, true)}`, util.execOptsLinux).toString().split('\n');
488
488
  const mdData = decodeMdabmData(lines);
489
489
 
490
490
  element.label = mdData.label; // <- assign label info
package/lib/network.js CHANGED
@@ -1337,7 +1337,7 @@ function networkStatsSingle(iface) {
1337
1337
 
1338
1338
  return new Promise((resolve) => {
1339
1339
  process.nextTick(() => {
1340
- const ifaceSanitized = util.sanitizeString(iface);
1340
+ const ifaceSanitized = util.sanitizeString(iface, true);
1341
1341
 
1342
1342
  let result = {
1343
1343
  iface: ifaceSanitized,
package/lib/wifi.js CHANGED
@@ -229,7 +229,7 @@ function wpaConnectionLinux(iface) {
229
229
  if (!iface) {
230
230
  return {};
231
231
  }
232
- const cmd = `wpa_cli -i ${iface} status 2>&1`;
232
+ const cmd = `wpa_cli -i ${util.sanitizeString(iface, true)} status 2>&1`;
233
233
  try {
234
234
  const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
235
235
  const freq = util.toInt(util.getValue(lines, 'freq', '='));
@@ -284,7 +284,7 @@ function getWifiNetworkListNmi() {
284
284
  function getWifiNetworkListIw(iface) {
285
285
  const result = [];
286
286
  try {
287
- let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`, util.execOptsLinux).toString().split(' Cell ');
287
+ let iwlistParts = execSync(`export LC_ALL=C; iwlist ${util.sanitizeString(iface, true)} scan 2>&1; unset LC_ALL`, util.execOptsLinux).toString().split(' Cell ');
288
288
  if (iwlistParts[0].indexOf('resource busy') >= 0) {
289
289
  return -1;
290
290
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.14",
3
+ "version": "5.31.16",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",