systeminformation 5.21.5 → 5.21.7

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/system.js CHANGED
@@ -318,10 +318,11 @@ function system(callback) {
318
318
  exports.system = system;
319
319
 
320
320
  function cleanDefaults(s) {
321
- if (s === 'Default string') { s = ''; }
322
- if (s.toLowerCase().indexOf('o.e.m.') !== -1) { s = ''; }
323
-
324
- return s
321
+ const cmpStr = s.toLowerCase();
322
+ if (cmpStr.indexOf('o.e.m.') === -1 && cmpStr.indexOf('default string') === -1 && cmpStr !== 'default') {
323
+ return s || '';
324
+ }
325
+ return '';
325
326
  }
326
327
  function bios(callback) {
327
328
 
@@ -561,7 +562,7 @@ function baseboard(callback) {
561
562
  const workload = [];
562
563
  const win10plus = parseInt(os.release()) >= 10;
563
564
  const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
564
- workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl'));
565
+ workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
565
566
  workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
566
567
  util.promiseAll(
567
568
  workload
@@ -579,9 +580,6 @@ function baseboard(callback) {
579
580
  if (!result.assetTag) {
580
581
  result.assetTag = cleanDefaults(util.getValue(lines, 'sku', ':'));
581
582
  }
582
- if (!result.assetTag) {
583
- result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
584
- }
585
583
 
586
584
  // memphysical
587
585
  lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];
package/lib/util.js CHANGED
@@ -709,6 +709,7 @@ function sanitizeShellString(str, strict) {
709
709
  (strict && s[i] === '@') ||
710
710
  (strict && s[i] === ' ') ||
711
711
  (strict && s[i] == '{') ||
712
+ (strict && s[i] == ';') ||
712
713
  (strict && s[i] == ')'))) {
713
714
  result = result + s[i];
714
715
  }
package/lib/wifi.js CHANGED
@@ -401,7 +401,15 @@ function wifiNetworks(callback) {
401
401
  }
402
402
  });
403
403
  if (iface) {
404
- const res = getWifiNetworkListIw(iface);
404
+ let ifaceSanitized = '';
405
+ const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface, true);
406
+ for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
407
+ if (s[i] !== undefined) {
408
+ ifaceSanitized = ifaceSanitized + s[i];
409
+ }
410
+ }
411
+
412
+ const res = getWifiNetworkListIw(ifaceSanitized);
405
413
  if (res === -1) {
406
414
  // try again after 4 secs
407
415
  setTimeout(function (iface) {
@@ -529,11 +537,27 @@ function wifiConnections(callback) {
529
537
  const ifaces = ifaceListLinux();
530
538
  const networkList = getWifiNetworkListNmi();
531
539
  ifaces.forEach(ifaceDetail => {
532
- const nmiDetails = nmiDeviceLinux(ifaceDetail.iface);
533
- const wpaDetails = wpaConnectionLinux(ifaceDetail.iface);
540
+ let ifaceSanitized = '';
541
+ const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ifaceDetail.iface, true);
542
+ for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
543
+ if (s[i] !== undefined) {
544
+ ifaceSanitized = ifaceSanitized + s[i];
545
+ }
546
+ }
547
+
548
+ const nmiDetails = nmiDeviceLinux(ifaceSanitized);
549
+ const wpaDetails = wpaConnectionLinux(ifaceSanitized);
534
550
  const ssid = nmiDetails.ssid || wpaDetails.ssid;
535
551
  const network = networkList.filter(nw => nw.ssid === ssid);
536
- const nmiConnection = nmiConnectionLinux(ssid);
552
+ let ssidSanitized = '';
553
+ const t = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(ssid, true);
554
+ for (let i = 0; i <= util.mathMin(t.length, 2000); i++) {
555
+ if (t[i] !== undefined) {
556
+ ssidSanitized = ssidSanitized + t[i];
557
+ }
558
+ }
559
+
560
+ const nmiConnection = nmiConnectionLinux(ssidSanitized);
537
561
  const channel = network && network.length && network[0].channel ? network[0].channel : (wpaDetails.channel ? wpaDetails.channel : null);
538
562
  const bssid = network && network.length && network[0].bssid ? network[0].bssid : (wpaDetails.bssid ? wpaDetails.bssid : null);
539
563
  if (ssid && bssid) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.5",
3
+ "version": "5.21.7",
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)",